Random Project

Awesome!

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