host event notifications

Andreas Ericsson ae at op5.se
Thu Mar 10 21:49:56 CET 2005


Robert.Lattanzi at fitchratings.com wrote:
> hello all-
>       i have about 50 network devices that i am monitoring. each one is
> configured as a host, with the check_command defined as check-host-alive.
> in addition, i have a ping of each device defined as a service, with
> event_handler enabled and set to "networkdevice-notify-by-epager", a custom
> script which dials a skytel paging server and sends directly to our pagers.
> the event handler works from the command line (as user nagios) and i get no
> complaints from nagios at startup about incorrect or nonexistent commands.
>       my first question is, is the ping service necessary? it doesn't seem
> as if it is. all i want to know is if each of the network thingies is up.
> check-host-alive should suffice, no?

Host checks aren't normally scheduled, and it's not advisable to do so 
since they aren't executed in parallell. That means that while one host 
is being checked, no other checks are being performed.

>       second, and more pressing, is that when testing all of this against a
> "fake" IP address (sure to return a CRITICAL error), neither my host event
> handler nor the service event handler gets triggered. The host shows up as
> CRITICAL in the UI, but nothing else happens. Moreover, I see the event
> handler for the host being called in nagios.log, but that's where it ends.

You have a bug in your command definition.

> Below are config file snippets. Thanks in advance, Robert
> 
> hosts.cfg entry:
> define host{
>         use                     generic-host
>         host_name               test
>         alias                   test
>         address                 193.168.4.36
>         check_command           check-host-alive
>         event_handler           networkdevice-notify-by-epager
>         event_handler_enabled   1
>         max_check_attempts      1
>         notification_interval   480
>         notification_period     24x7
>         notification_options    d,u,r
> }
> 
> services.cfg entry:
> define service {
>         use                             generic-service
>         host_name                    test
>         service_description             PING
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           5
>         retry_check_interval            1
>         contact_groups                  linux-admins-dialpager
>         notifications_enabled           1
>         notification_period             24x7
>         notification_options            c,r
>         check_command                   check_ping!100.0,20%!500.0,60%
>         event_handler                   networkdevice-notify-by-epager
>         }
> 
> miscommands.cfg entry:
> define command{
>         command_name    networkdevice-notify-by-epager
>         command_line     /usr/bin/snpp -m "$HOSTNAME$ (IP: $HOSTADDRESS$)
> is $HOSTSTATE$ Info: $OUTPUT$ Time: $DATETIME$" $CONTACTPAGER$
> }
> 

The opening quotation mark misses its mate. Put a " after $CONTACTPAGER$ 
and things might work a bit better.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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