I just created a script Nagcheck to read services status in Nagios. It reads all the nagios settings, parse them, then create a report based on what you ask for.
With this script, you can do the following things:
- List the notification disabled (or enabled) hosts
- List the notification disabled (or enabled) services
- List the active check (or passive check) disabled (or enabled) services.
- The above output can be sent as mail if you enable its –mail-to parameter with an email address.
Here are two command-line examples:
Find out how many hosts in nagios that have notifications disabled.
$ ruby nagcheck.rb --statusfile /var/cache/nagios/status.dat --list-hosts --notify-disabled Pub.Admon.org
Find out how many services in nagios that have passive-check disabled, and email the output to firstname.lastname@example.org.
$ ruby nagcheck.rb --statusfile /var/cache/nagios/status.dat --list-service --active-disabled --mail-to email@example.com
There is no output from this command. The filtered services are listed in the following format:
If you face any issues, please don’t hesitate to drop me a comment here, thanks!