passive service and notification email

Jim Avery jim at jimavery.me.uk
Tue Oct 26 20:42:45 CEST 2010


On 26 October 2010 10:09, Andrea Imparato <imparato.andrea at gmail.com> wrote:
> Hello to all ml,
>
>
> I have a simple request for you. I have a passive service check
> scheduled on my nagios server and a cron script on my clients (they are
> all natted) that send me the informations. The question is: which is the
> parameter for nagios that say "after some period send me an email if you
> see nothing happens?". Sorry but I found the documentation a bit
> chaotic :\

See:

http://nagios.sourceforge.net/docs/3_0/freshness.html

So the important bits are ...

Make sure it's a passive check:

active_checks_enabled	0
passive_checks_enabled	1

Check whether a fresh check has been received recently:

check_freshness		1
freshness_threshold	93600

Run this this if not fresh:

check_command		no-backup-report


In this case, instead of a normal check command, you have a command
defined which will always give you a non-ok warning:

define command{
	command_name	no-backup-report
	command_line	/usr/local/nagios/libexec/check_dummy 2 "CRITICAL:
Results of backup job were not reported!"
	}

Note the check_dummy plugin takes two arguments - the exit code you
want it to return (0=ok, 1=warning, 2=critical, 3=unknown) and the
check result text you want Nagios to display.

I normally do something similar, but with pedantically correct text like so:

define command{
	command_name	check_dummy-checkfail
	command_line	/usr/local/nagios/libexec/check_dummy 3 "UNKNOWN: Nagios
didn't receive a check result from the cron job on this server!"
	}

Whether you choose to use warning, critical or unknown is up to you.

hth,

Jim

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
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