We have lot of scripts which do automatic maintenance work during weekends. Eventhough the scripts are written to take care of errors it doesn't have a option to notify nagios that the maintenance work is taking place.
The person who is Oncall also gets frustrated seeing the alerts disturbing his weekend peace. He might even screw up the entire maintenance taking place.
Hence we needed the script to notify nagios that a maintenance is taking place and not to send out notifications.
We were using nagios3 as the monitoring service. The great command line utility curl came in handy here.
We use curl to send a POST request to the nagios admin interface emulating a user experience.
Disable notification to service.
curl -d "cmd_mod=2&cmd_typ=23&host=rayber01&service=MYSQL&btnSubmit=Commit" "https://rayber.blogspot.com/nagios/cgi-bin/cmd.cgi" --insecure -uray:testray
Host= rayber01 Hostname for which you need service notification disabled
-uray:testray = User authentication in nagios interface.
Enable Notification of service:
Once the maintenance work is complete we need to enable notification for the service.
curl -d "cmd_mod=2&cmd_typ=22&host=rayber01&service=MYSQL&btnSubmit=Commit" "https://rayber.blogspot.com/nagios/cgi-bin/cmd.cgi" --insecure -uray:testray
You can do a lot of other custom commands using curl. I use Firebug to translate the POST requests being send to the nagios admin interface.
You can completely disable notifications on a host as well..
Great Article. Thank you for sharing! Really an awesome post for every one.
ReplyDeleteBig Data Based Improved Data Acquisition and Storage System for Designing Industrial Data Platform Project For CSE
Compressed Sensing and Its Applications in Risk Assessment for Internet Supply Chain Finance Under Big Data Project For CSE
Exploring behavioral heterogeneities of elementary school students’ commute mode choices through the urban travel big data of Beijing, China Project For CSE
FTLADS Object Logging based Fault Tolerant Big Data Transfer System using Layout Aware Data Scheduling Project For CSE
Intelligent Big Data Summarization for Rare Anomaly Detection Project For CSE
Algorithm A New Probabilistic ProcessLearning Approach for Big Data in Healthcare Project For CSE