run a script based on event??
Chris Wilson
chris at aidworld.org
Fri Aug 5 13:17:31 CEST 2005
Hi,
> Ok im a little confussed now...is the following possible via nagios?
>
> Monitor a temp probe in lab (this i know is possible via snmp)...if the temp
> value goes critical then run check_nrpe (through an event handler)...which
> will then run a script on the windows machine?
>
> --->>> can check_nrpe be run as an event handler once the temp value is
> critical?
Yes. You can run any command as an event handler, including NRPE,
check_by_ssh, or ssh itself. See the Event Handler documentation link
which Marc Powell sent you.
But rather than running check_nrpe directly, you probably want to run a
shell script as your event handler, because you will need to check the
type of event (CRITICAL state, HARD type) before shutting down the
machine:
#!/bin/sh
if [ "$1" = "CRITICAL" -a "$2" = "HARD" ]; then
check_nrpe -H windows.box -c shutdown.command.name
fi
assuming that you pass $SERVICESTATE$ and $STATETYPE$ as the parameters
to the event handler in your command definition, as shown in the Event
Handlers documentation.
Cheers, Chris.
--
(aidworld) chris wilson | chief engineer (chris at aidworld.org)
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list