Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
@chandlercord
Favorites0
Views
Projects0
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
Reviewed 14 years ago