[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Nagios/Groundwork's issue
From: |
Michael Hutchinson |
Subject: |
RE: Nagios/Groundwork's issue |
Date: |
Thu, 24 Sep 2009 14:09:44 +1200 |
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Daniele Forsi
> Sent: Thursday, 24 September 2009 8:02 a.m.
> To: Discussion forum for gnokii users.
> Subject: Re: Nagios/Groundwork's issue
>
> 2009/9/23 Martyn:
>
> > Looking at the Nagios code below; how would I formulate a meaningful
> Nagios
> > alert using Gnokii.
>
> I don't know, you should ask Nagios people and probably there are
> examples around
>
I use these directives for Nagios 1.3 running on Debian Sarge with a
serial-port connected Nokia phone, found in misccommands.cfg Nagios
config file.
# sms notify using gnokii-smsd
define command{
command_name host-notify-by-sms
command_line /usr/bin/printf
"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$" >
/var/spool/sms/$TIMET$
}
define command{
command_name notify-by-sms
command_line /usr/bin/printf
"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$" > /var/spool/sms/$TIMET$
}
Gnokii operates in directory mode, and checks /var/spool/sms constantly.
If a new file is found there, it's treated as a text message, the first
line of which is the destination phone number, and the next line is the
message.
Works very well, and has been doing so for over 4 years.
Here are the lines I use in misccommands.cfg with Nagios3 running under
Centreon. This was built around 4 years after the previous system.
define command{
command_name host-notify-by-sms
command_line /usr/bin/printf
"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTNAME$ is $HOSTSTATE$" >
/var/spool/sms/`date +%d%m%Y%H%M%S%N`
}
define command{
command_name notify-by-sms
command_line /usr/bin/printf
"$CONTACTPAGER$\n$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$" > /var/spool/sms/`date +%d%m%Y%H%M%S%N`
}
You can see, in the last 4-5 years, not much has changed with Nagios
when using Gnokii for alerting ;-)
Cheers,
Mike