notification command configuration

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Mon Jan 27 02:30:58 CET 2003


Dear Sir,


On Sun, Jan 26, 2003 at 12:44:50PM -0800, W. J. Williams wrote:
> I am using FreeBSD 4.7, Sendmail 8.x and Nagios 1.0
> 
> Can someone tell me how to configure the host-notify-by-email command in
> the checkcommand.cfg.  It appears I have all the other cfgs configured
> correctly, but missing the config for actually making the notification get
> sent through my mail service.
>

These definitions are in my etc/misccommands.cfg file at this FreeBSD
site.

tsitc> uname -a
FreeBSD tsitc.aipo.gov.au 4.7-RELEASE FreeBSD 4.7-RELEASE #2: Thu Nov  7
20:33:03 EST 2002     root at tsitc.aipo.gov.au:/usr/obj/usr/src/sys/TSITC
i386

tsitc> sendmail -d0.5 -bp | head -1
Version 8.12.6

tsitc# /usr/local/nagios/bin/nagios -V

Nagios 1.0
Copyright (c) 1999-2002 Ethan Galstad (nagios at nagios.org)
Last Modified: 11-24-2002
License: GPL

tsitc> grep -3 host-notify /usr/local/nagios/etc/misccommands.cfg
        }


# 'host-notify-by-email' command definition
define command{
        command_name    host-notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios 1.0
*****\n\nNotification
Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" |
/usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
        }


# 'host-notify-by-epager' command definition
define command{
        command_name    host-notify-by-epager
        command_line    /usr/bin/printf '%b' '$HOSTNAME$/$HOSTADDRESS$
is $HOSTSTATE$ at $DATETIME$ $OUTPUT$' | /usr/bin/head -c 160 |
/usr/bin/mail $CONTACTPAGER$     
        }

tsitc> 

Does your Nag pass the -v check ?

FYI, Smslink/Libmodem also ports to FreeBSD (there may even be an
official port by now) so you can use Sendmail to queue notify-by-epager
messages for dispatch by an SMS modem or bank of SMS modems - handy if
you have that catastrophic NAS, power or Enterprise Storage System
failure: everyone can quickly hear about the disaster.

Yours sincerely.

-- 
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------

'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'

from Meditation 17, J Donne.


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list