Hi All,
I was wondering if there is a way to send a command to Nagios from init script upon application container shutdown, to disable specific monitors automatically. Any API, or cgi maybe.
Thanks
Automating disable request
Re: Automating disable request
http://old.nagios.org/developerinfo/ext ... ndlist.php
You'll want to write to the nagios.cmd file. All commands with example scripts are listed.
In particular:
Single host disable
Hostgroup disable
Similar commands exist for services and servicegroups.
You'll want to write to the nagios.cmd file. All commands with example scripts are listed.
In particular:
Single host disable
Hostgroup disable
Similar commands exist for services and servicegroups.
Former Nagios employee
Re: Automating disable request
We do this all the time for event handlers where we know the restart will take longer than the check interval. We temporarily stop Nagios's service checks while the event handler starts, and then enable them again when it completes. The trick is, what happens if something goes wrong in the middle?
So we also have a lock file that we put in place. The event handler creates this and deletes this as well. A cleanup gizmo comes along every ten minutes and looks for lock files that are 60 minutes old (or older). If there are any, it assumes that the event handler died, kills the lock file, enables the nagios service, and everything starts back over again with notifications handled through Nagios.
So we also have a lock file that we put in place. The event handler creates this and deletes this as well. A cleanup gizmo comes along every ten minutes and looks for lock files that are 60 minutes old (or older). If there are any, it assumes that the event handler died, kills the lock file, enables the nagios service, and everything starts back over again with notifications handled through Nagios.
-
- Posts: 22
- Joined: Wed Jun 18, 2014 4:15 am
Re: Automating disable request
my simple trick to find the API is to perform the task you wanted to from nagios web gui, use a http track tools (eg. Developer Tools in Chrome) to record the GET/POST action.
Then use whatever utility( wget, curl, msxml ) to simulate the action again when necessary.
Then use whatever utility( wget, curl, msxml ) to simulate the action again when necessary.
Re: Automating disable request
Yup, you can do that too. Be forewarned about network security and all that, but yes.