Extenal Command/Service Command - User initiated


Hi all:
Great package, easy to install - very nice.

Is it possible to create a USER INITIATED command? My example - I am monitoring a custom daemon, when it goes down - I would like to have the user initiate a Service Command for that process to restart it - rather than starting it automatically for now for debug purposes.

I’ve not seen any requests for this (or I may be missing something) - If anyone can point me in the right direction I’d appreciate it.

Thanks in advance for any advice.


not sure what you mean. having a user initiate a service restart command doesn’t have anything to do with nagios.

you could do it automatically by creating a new ‘notify-by-email’ type command that nagios runs for a service alert (your current config has it running /bin/mail currently, replace/add the appropriate script to command_line).

i dunno, maybe you can use the above example but make a script that asks for user input then logs into a box and runs a command…


Thanks. I want to have the “operator” restart the the daemon (with the press of a button) rather than have Nagios restart it automatically. I see this type of operation doesn’t seem to be permitted in Nagios other than the pre-canned Service Commands


I have, on occasion, considered creating a Perl/CGI script to restart a particular service that can be run from a simple web page with something like just a link to the aforementioned script (i.e. “Are you sure you want to restart this service?” or “Click here to restart service xyz”), then link that simple web page into nagios through use of the action_url parameter for the service object. Service goes down, operator clicks on the Extra Actions ‘splat’ icon and up pops your simple webpage. Then, they click the link to fire the cgi script and that restarts the service… (you could I suppose link the script direct to the action_url instead of using an intermediary web page, but I think that would be asking for trouble)

At least, thats the theory :frowning: