<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.24">
<TITLE>Macro usage when sending SMS</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Hi all !!!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Just started as a Nagios user so I am new on the list.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I have nagios running and I also have a basic structure in place for</FONT>
<BR><FONT SIZE=2 FACE="Arial">sending SMS'es ( using smstools ). I need to expand it now because I have</FONT>
<BR><FONT SIZE=2 FACE="Arial">many people that want to be notified of only selected system information.</FONT>
<BR><FONT SIZE=2 FACE="Arial">At this point in time, all contacts are sent ALL information.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">So , bottom line is, I need to diffrentiate based on $USERNAME$ as defined in</FONT>
<BR><FONT SIZE=2 FACE="Arial">my contacts.</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial">define command{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">command_name notify-by-sms</FONT>
<BR> <FONT SIZE=2 FACE="Arial">command_line /usr/local/nagios/libexec/send_sms $HOSTNAME$ $HOSTSTATE$ $USERNAME</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">And then in ../libexec , my "send_sms"-script looks as follows: ( This is how it looks CURRENTLY )</FONT>
</P>
<BR>
<P><FONT SIZE=2 FACE="Arial">#!/bin/bash</FONT>
<BR><FONT SIZE=2 FACE="Arial">HOST = $1</FONT>
<BR><FONT SIZE=2 FACE="Arial">STATE = $2</FONT>
<BR><FONT SIZE=2 FACE="Arial">../sms/smstools/scripts/sendsms 0821111111 "$HOST $STATE"</FONT>
<BR><FONT SIZE=2 FACE="Arial">../sms/smstools/scripts/sendsms 0822222222 "$HOST $STATE"</FONT>
<BR><FONT SIZE=2 FACE="Arial">[ entry for each cell-number ]</FONT>
</P>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial">I would like to make use of $USERNAME$ to control what gets sent to who.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">But, when I print the contents of $USERNAME$ in the script, it is either blank or</FONT>
<BR><FONT SIZE=2 FACE="Arial">it contains "-". </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I do have all my contacts defined in my ../minimal.cfg file</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">OS = CentOS4.0</FONT>
<BR><FONT SIZE=2 FACE="Arial">Nagios 2.4</FONT>
<BR><FONT SIZE=2 FACE="Arial">smstools 2.2.4</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">a Pointer would be much appreciated ???</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks !</FONT>
<BR><FONT SIZE=2 FACE="Arial">John Longland</FONT>
</P>
</BODY>
</HTML>