Nabaztag tells you your Nagios/Icinga status

Posted on Monday, February 15th, 2010 at 4:23 am in

I thought it’s a good idea to use Nabaztag also for a regular status message about the host and service state.

Based on my other script notify-by-nabaztag.php (see this post) i’ve wrote another little PHP-Script which gets the Nagios/Icinga Status from the nagiostats/icingastats utility and use my notify-by-nabaztag.php to send out a status message. Here it is: status2nabaztag.php

There are just a few steps to get up and running:

1. Grap my notify-by-nabaztag.php and the status2nabaztag.php scripts

wget -O /usr/local/icinga/libexec/notify-by-nabaztag.php

wget -O /usr/local/icinga/bin/status2nabaztag.php

2. Change, if required, paths to the binaries. Specially $stats & $php

3. Test it πŸ˜‰

php /usr/local/icinga/bin/status2nabaztag.php

4. Assuming everything worked as expected you can add an entry to your crontab to regulary executes the script. I know, it would be a nicer to use the Nagios/Icinga timeperiod-definitions, but the crontab-entry is easier πŸ˜‰

vim /etc/crontab

0 6-23 * * * root /usr/bin/php /usr/local/icinga/bin/status2nabaztag.php

This cron entry will executes the script every day between 6am and 11pm.

It’s just a short post, but i think the script should be self explaining too. Furthermore it’s quite late/early, so i’ll try to get some sleep because i have to get up in 3hours πŸ˜‰

Hope this script is useful too. Please let me know if you have any troubles to get it running.

Remember: In god we trust, the rest we monitor πŸ™‚

You might also be interested in

1 Comment

Add your comment

  1. Scott Evans - February 25, 2010 at 1:29 pm

    I have made a blog post on the Icinga site about your efforts! this can be viewed at

    Great work! πŸ˜‰

Leave a Reply

Leave A Comment