SMS notifications from Nagios

Shane_Seidel at gwf.com.au Shane_Seidel at gwf.com.au
Thu Feb 20 09:12:18 CET 2003





Hello All,

I am trying to enable SMS messaging from Nagios 1.0 on RH7.3 using the howto
written by Giulius.
Note that I am still using the the default file config but with seperated files.

After configuring as descibed below and running /usr/local/nagios/bin/nagios -v
/usr/local/nagios/etc/nagios.cfg I was prenented with one error..Host
notification command 'notify-by-sms' specified for contact 'gwfisSMS' is not
defined anywhere! ( I have substituted the contact as gwfisSMS). This led me to
believe that a command was required in misscommands.cfg. (For testing I am using
1 service) Therefore I used...

command[notify-by-sms]=/usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost:
$HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate:
$DATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$" $CONTACTPAGER$

This removed the error but no SMS

hosts.cfg
host[nms-GWFIS-Monitoring-System]=giswnms-GWFIS-Monitoring-System;10.1.172.57;;check-host-alive;3;60;24x7;1;1;1;

services.cfg
service[nms-GWFIS-Monitoring-System]=PING Backup
LAN;0;24x7;3;2;1;gwfis-sms;240;24x7;1;1;0;;check_baklan_NMS
contactgroups.cfg
contactgroup[gwfis-sms]=GWFIS Administrators;gwfisSMS
checkcommands.cfg
command[sms]=/usr/bin/printf "MESSAGE+VARIABLE" | /usr/bin/gnokii --sendsms
+61XXXXXXXXX -C0 2>/dev/null
misscomands.cfg
command[notify-by-sms]=/usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost:
$HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate:
$DATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$" $CONTACTPAGER$

I suspect the 

**********************************************************************************************************************************************
This email and its attachments are confidential subject to copyright and may be legally privileged. If they have come to 
you in error you should take no action based upon the contents nor should you copy or show them to anyone. Please 
delete the email and its attachments and inform administrators at gwf.com.au
Any views or opinions expressed are those of the author and do not necessarily represent those of George Weston Foods 
Ltd.
Security: Internet email is not a completely secure medium, please note this when considering the content of your message.
Viruses: We take precautions to ensure email is free of viruses but cannot guarantee this. Accordingly we advise
scanning all email and attachments
*********************************************************************************************************************************************

-------------- next part --------------

?$CONTACTPAGER$ variable and/or the phone number format (Giulius's
howto hs the number enclosed with [ ] ) but I am unsure how to proceed. If
anyone can clarrify/assist I would be most thankfull

Shane



FROM: GiuliusDATE: 08/30/2002 03:25:22SUBJECT: ?[netsaint] HOW TO USE SMS
NOTIFICATION + GNOKII This is a little HOWTO that help who try to run gnokii
with netsaint on unix systems for sms notification:

TO use gnokii with netasint you "must" know 3 things:

1)Netsaint cannot understand any replay output/error given by gnokii;
2)Netsaint user (process owner) must have the ability to read/write on
the serial (or any other device like irda) connected to the gsm sender
3)Netsaint user (process owner) must read/write on lock directory


1) add this command to netsaint host.cfg
command[sms]=/path/to/printf "MESSAGE+VARIABLE" | /path/to/gnokii
--sendsms [gsm number] -C0 2>/dev/null
add olso the contact information about sms like this:
contact[netsaint]=Netsaint
User;24x7;24x7;1;1;1;1;1;1;notify-by-email,notify-by-epager,notify-by-sms;host-notify-by-email,host-notify-by-epager,host-notify-by-sms;netsaint;netsaint


Remember:
if you forget to add ? "2>/dev/null" ?on the end of the command line,
the result was a broken pipe and netsaint
cannot go over, freezing all the netsaint process.

2)Remember to set permission RW on serial (or any other device like
irda) device to user netsaint (or process owner). This to permit
Read Write on device attached to gsm cel.
There are differently method to do this based on type of unix you own.
You must find this on yourself.

3)Now you must configure gnokii in order to use lock files (to avoid
conflict with other devices that use serial/usb).
On gnokii/etc directory un can find a file called gnokiirc.
Make sure that contain this:

port = /dev/ (device attached to gsm)
model = (the model number of your nokia gsm like 6210)
connection = serial (or you connection to gsm cel. like irda, ecc.)
use_locking = yes

Now you are ready to receive sms about notification of netsaint.


Bye.
Giulius.


More information about the Users mailing list