Hello list, I'm having a spot of trouble executing a remote command via an event handler.
This is just a simple test to restart a remote HTTPD. The event handler is
correctly triggered:
[1310974191] SERVICE ALERT: mybox;Apache processes;CRITICAL;SOFT;1;PROCS
CRITICAL: 0 processes with command name 'httpd'
[1310974191] SERVICE EVENT HANDLER: mybox;Apache
processes;CRITICAL;SOFT;1;host119_service53_eh-restart_remote_httpd
[1310974251] SERVICE ALERT: mybox;Apache processes;CRITICAL;SOFT;2;PROCS
CRITICAL: 0 processes with command name 'httpd'
[1310974251] SERVICE EVENT HANDLER: mybox;Apache
processes;CRITICAL;SOFT;2;host119_service53_eh-restart_remote_httpd
[1310974311] SERVICE ALERT: mybox;Apache processes;CRITICAL;HARD;3;PROCS
CRITICAL: 0 processes with command name 'httpd'
[1310974311] SERVICE EVENT HANDLER: mybox;Apache
processes;CRITICAL;HARD;3;host119_service53_eh-restart_remote_httpd
The eventhandler script simply contains the sample opsview script calling
check_nrpe -c restart_httpd:
if [[ "$NAGIOS_SERVICESTATE" = "CRITICAL" && "$NAGIOS_SERVICESTATETYPE" =
"HARD" ]]
then
echo "conditions match"
/usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c restart_httpd
fi
So, while Opsview correctly triggers the event handler, no command is executed
on the remote server. If I run the command by hand, it works like a charm:
[nagios@opsview libexec]$ ./check_nrpe -H mybox -c restart_httpd
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
Any thoughts on what might be wrong here? Much appreciated.
Kind regards,
Wilco
Wilco Noordermeer
IT Operations Manager
Tel.: +31 71 5451 161 / +31 6 4798 8000
Leidse Onderwijsinstellingen bv
Leidsedreef 2
2352 BA Leiderdorp
www.loi.nl
________________________________
[Nederland wordt steeds slimmer. Leidse Onderwijsinstellingen]
De informatie verzonden met dit e-mailbericht (en bijlagen) is uitsluitend
bestemd voor de geadresseerde(n) en zij die van de geadresseerde(n) toestemming
hebben dit bericht te lezen. Gebruik door anderen dan geadresseerde(n) is
verboden. De informatie in dit e-mailbericht (en de bijlagen) kan vertrouwelijk
van aard zijn en kan binnen het bereik vallen van een wettelijke
geheimhoudingsplicht. Indien u deze e-mail ten onrechte ontvangen hebt, wordt u
verzocht ons daarvan zo spoedig mogelijk per e-mail of telefonisch op de hoogte
te stellen, en het ontvangen bericht (en de bijlagen) te wissen zonder deze te
lezen, te kopi?ren of aan derden bekend te stellen.
P Denk aan het milieu voordat u dit bericht print
<<inline: nwss_loi29.gif>>
_______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users
