I need a script to get me a list of all commented "#" ed checks for my nagios servers, each server has a .cfg file and a Hostgroup folder, below is an example:
Folder
/opt/nagios/etc
|
mars venus earth
|
mars1.cfg venus1.cfg
mars2.cfg venus2.cfg
now i need a script to check every cfg file for the entry service_description and if it has been commented then make a list of the same:
Below is one such cfg file
mars1.cfg
#define service{
# use generic-service
# host_name mars1
# service_description Firewall
# notifications_enabled 1
define service{
use generic-service
host_name mars1
service_description Queue Size
notifications_enabled 1
So in this case i would have a file called commentedchecks which would contain the entry
mars1.cfg
Firewall
mars2.cfg
etc etc