How to surpess notifications if ping fails.

Jon Angliss jon at netdork.net
Wed Jul 1 06:08:09 CEST 2009


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>

------------------------------------------------------------------------------
_______________________________________________
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