Macro usage when sending SMS

John Longland jlongland at grintek.com
Tue Sep 5 08:39:35 CEST 2006


Hi all !!!

Just started as a Nagios user so I am new on the list.

I have nagios running and I also have a basic structure in place for
sending SMS'es ( using smstools ). I need to expand it now because I have
many people that want to be notified of only selected system information.
At this point in time, all contacts are sent ALL information.

So , bottom line is, I need to diffrentiate based on $USERNAME$ as defined
in
my contacts.



define command{
	command_name	notify-by-sms
	command_line		/usr/local/nagios/libexec/send_sms
$HOSTNAME$ $HOSTSTATE$ $USERNAME
}


And then in ../libexec , my "send_sms"-script looks as follows: ( This is
how it looks CURRENTLY )


#!/bin/bash
HOST = $1
STATE = $2
../sms/smstools/scripts/sendsms 0821111111 "$HOST $STATE"
../sms/smstools/scripts/sendsms 0822222222 "$HOST $STATE"
[ entry for each cell-number ]



I would like to make use of $USERNAME$ to control what gets sent to who.

But, when I print the contents of $USERNAME$ in the script, it is either
blank or
it contains "-". 

I do have all my contacts defined in my ../minimal.cfg file

OS = CentOS4.0
Nagios 2.4
smstools 2.2.4

a Pointer would be much appreciated ???

Thanks !
John Longland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060905/4bf3dc55/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
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