Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Directory

chandlercord

Reviews(1)
bychandlercord, August 5, 2011
Awesome, great for a busy admin.

I put together a awk a to check if nofitications are disabled globally.


BEGIN { header=0;
FS="=";
}

/^[[:space:]]*info {[[:space:]]*$/ {
codeblock="info";
}

/^[[:space:]]*programstatus {[[:space:]]*$/ {
codeblock="program";
notifications_enabled="";
}

/^[[:space:]]*hoststatus {[[:space:]]*$/ {
codeblock="host";
}

/^[[:space:]]*servicestatus {[[:space:]]*$/ {
codeblock="service";
}

/^[[:space:]]*enable_notifications=/ {
notifications_enabled=$2;
}

/^[[:space:]]*}[[:space:]]*$/ {
if (codeblock=="program" && notifications_enabled=="0") {
if (header==0) {
print "
******************
Notifications have been disabled globally!!!!!!!
";

header=1;
}
print host_name;
}
}

Figure that might be useful to someone