How to surpess notifications if ping fails.

Jeremiah Jester jeremiahjester at gmail.com
Thu Jul 2 22:54:30 CEST 2009


For some reason notifications are not being sent from nagios when i unplug
the network cable from one of the hosts being monitored.

Nagios recognizes that the hose is down but no notification...

[1246567497] HOST ALERT: psefilesrv;DOWN;SOFT;1;(No Information Returned
>From Host Check)
[1246567528] Warning: Host check command '/usr/lib/nagios/plugins/check_ping
-H 10.139.68.39 -w 3000.0,80% -c 5000.0,100% -p 5' for host 'psefilesrv'
timed out after 30 seconds
[1246567528] HOST ALERT: psefilesrv;DOWN;SOFT;2;(No Information Returned
>From Host Check)
[1246567559] Warning: Host check command '/usr/lib/nagios/plugins/check_ping
-H 10.139.68.39 -w 3000.0,80% -c 5000.0,100% -p 5' for host 'psefilesrv'
timed out after 30 seconds
[1246567559] HOST ALERT: psefilesrv;DOWN;HARD;3;(No Information Returned
>From Host Check)
[1246567559] HOST NOTIFICATION:
root;psefilesrv;DOWN;host-notify-by-email;(No Information Returned From Host
Check)

Here is the host config...

define host{
  host_name  psefilesrv
  alias      misc
  address    10.139.68.39
  use        generic-host
  check_command           check_alive
  notification_options    d,r
  max_check_attempts      3
  check_interval          1
  notification_interval 1
  notification_period 24x7
  notifications_enabled 1
  parents    switch-office
}

And the command...

define command {
    command_name    check_alive
    command_line    /usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w
3000.0,80% -c 5000.0,100% -p 5
}

Any thoughts to why this isn't working? Email notifications for other
services is working fine. Maybe i need to add check_alive as a service?


Thanks,
JJ







On Wed, Jul 1, 2009 at 3:17 PM, Jeremiah Jester <jeremiahjester at gmail.com>wrote:

> I removed it and notifications are still being sent for all services
> associated with this host. Thoughts?
>
> JJ
>
>
> On Wed, Jul 1, 2009 at 3:15 PM, Jon Angliss <jon at netdork.net> wrote:
>
>> Jeremiah Jester wrote:
>> > Hmmm, tryied this...but not working. Also, i get an error when i specify
>> > 'retry_interval'. maybe n agios3 only?
>> >
>> > define host{
>> >     host_name               psedev2
>> >     alias                   dev
>> >     check_command           check-host-alive
>> >     notification_options    d,r
>> >     max_check_attempts      3
>> >     check_interval          1
>> >     retry_interval          1
>> >     address                 10.139.10.42
>> >     use                     generic-host
>> >     parents                 switch-office
>> > }
>> >
>> > Error log:
>> > [1246481763] Error: Invalid host object directive 'retry_interval'.
>> > [1246481763] Error: Could not add object property in file
>> > '/etc/nagios2/conf.d/generic-host_nagios2.cfg' on line 143.
>> > [1246481763] Bailing out due to one or more errors encountered in the
>> > configuration files.  Run Nagios from the command line with the -v
>> > option to verify your config before restarting. (PID=27490)
>>
>> Yep, that'd be a nagios 3 option.  I'd not realized (or maybe
>> missed) you were using v2.  Just remove that option.
>>
>> --
>> Jon Angliss
>> <jon at netdork.net>
>>
>>
>> >
>> >
>> > Thanks,
>> > JJ
>> >
>> >
>> > On Tue, Jun 30, 2009 at 9:08 PM, Jon Angliss <jon at netdork.net
>> > <mailto:jon at netdork.net>> wrote:
>> >
>> >     Jeremiah Jester wrote:
>> >     > Jon,
>> >     >
>> >     > Thanks for the reply. I've been struggling with this for some
>> >     days. Can
>> >     > you give me an example of what how to define this and in what
>> file? I
>> >     > would appreciate your help.
>> >
>> >     Files don't really matter.  Nagios loads them all, and processes.
>> >     Its up to you how you want to format.  Sometimes it's easier to
>> >     group by type (hosts, services, commands, etc), and others by
>> >     location (server room, etc).  How you format is up to you.  If you
>> >     want, you can even bundle it all in a single file.
>> >
>> >     Lines ending in \ are wrapped and should appear on a single line in
>> >     your config.
>> >
>> >     define command {
>> >            command_name    check-host-alive
>> >            command_line    $USER1$/check_ping -H $HOSTADDRESS$ \
>> >                                    -w 3000.0,80% -c 5000.0,100% \
>> >                                    -p 5
>> >     }
>> >
>> >     define command {
>> >            command_name    check_http
>> >            command_line    $USER1$/check_http -H $HOSTNAME$
>> >     }
>> >
>> >     define host {
>> >            host_name               myhost
>> >            address                 1.1.1.1
>> >            check_command           check-host-alive
>> >            notification_options    d,r
>> >            check_period            All
>> >            max_check_attempts      3
>> >            check_interval          1
>> >            retry_interval          1
>> >            contact_groups          mycontacts
>> >     }
>> >
>> >     define service {
>> >            host_name               myhost
>> >            check_command           check_http
>> >            {.. other stuff here .. }
>> >     }
>> >
>> >     This will execute check_http against the "myhost".  check-host-alive
>> >     will be executed every 1 minute.  If check-host-alive fails 3 times,
>> >     host is considered down, and alerts for check_http will be
>> >     suppressed.  You should read up on host checks [1], service checks
>> >     [2], and notifications [3].
>> >
>> >     > Also, I've not seen v3 in the repsository but maybe i need to
>> >     change my
>> >     > sources?
>> >
>> >     You didn't mention which version of ubuntu you were using, but
>> >     jaunty has nagios3...
>> >
>> >      http://packages.ubuntu.com/jaunty/nagios3
>> >
>> >
>> >
>> >     [1]: http://nagios.sourceforge.net/docs/3_0/hostchecks.html
>> >     [2]: http://nagios.sourceforge.net/docs/3_0/servicechecks.html
>> >     [3]: http://nagios.sourceforge.net/docs/3_0/notifications.html
>> >
>> >     --
>> >     Jon Angliss
>> >     <jon at netdork.net <mailto:jon at netdork.net>>
>> >
>> >
>>
>>
>> --
>> Jon Angliss
>> <jon at netdork.net>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20090702/3c59dca8/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
-------------- 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