how macros on event handlers work
Marc Ismael
marcismael at gmail.com
Sat Apr 11 04:36:50 CEST 2009
Hi,
I'm slightly unsure about how i used event_handler in this situation
> [Fri Apr 10 05:38:16 2009];Nagios 3.0.6 starting... (PID=1017)
> [Fri Apr 10 05:38:16 2009];Local time is Fri Apr 10 05:38:16 EDT 2009
> [Fri Apr 10 05:38:16 2009];LOG VERSION: 2.0
> [Fri Apr 10 05:38:16 2009];Finished daemonizing... (New PID=1018)
> [Fri Apr 10 05:38:16 2009];INITIAL HOST STATE: remotehost;UP;HARD;1;
> [Fri Apr 10 05:38:16 2009];INITIAL HOST STATE: mynagios;UP;HARD;1;
> [Fri Apr 10 05:38:16 2009];INITIAL SERVICE STATE:
> remotehost;check_nagios_cronjob;OK;HARD;1;(null)
> [Fri Apr 10 05:38:16 2009];INITIAL SERVICE STATE: mynagios;Current
> Load;OK;HARD;1;(null)
> [Fri Apr 10 05:51:16 2009];Warning: The results of service
> 'check_nagios_cronjob' on host 'remotehost' are stale by 0d 0h 3m 0s
> (threshold=0d 0h 10m 0s). I'm forcing an immediate check of the service.
> [Fri Apr 10 05:51:21 2009];SERVICE ALERT:
> remotehost;check_nagios_cronjob;WARNING;HARD;1;WARNING: no information
> received from passive check (stale)
> [Fri Apr 10 05:51:21 2009];SERVICE EVENT HANDLER:
> remotehost;check_nagios_cronjob;(null);(null);(null);check_by_ssh
>
>
> define command{
> command_name check_by_ssh
> command_line $USER1$/eventhandlers/check_by_ssh.pl
> $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTNAME$
> }
>
>
>
> define service{
> use passive_template
> service_description check_nagios_cronjob
> hostgroup_name testgroup
> check_command i_am_stale
> event_handler check_by_ssh
> freshness_treshold 600
> }
>
>
> define command{
> command_name i_am_stale
> command_line $USER1$/check_dummy 1 "no information received from
> passive check (stale)"
> }
>
based on the configuration above, im expecting a passive check to timeout
after 10 mins. Then check_command will kick in, but it just returns
WARNING which is HARD (i've set max_check_attempts to 1). it will then
execute the event_handler, passing the macros $SERVICESTATE$
$SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTNAME$ as argument to
check_by_ssh.pl. But based on the log output above, these macros contain
'null'? i'm not sure why but im pretty sure macros are working since
$HOSTNAME$ was passed correctly.
Please give me a hint on what im missing.
Thanks,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090411/7127e076/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
-------------- next part --------------
_______________________________________________
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