<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi,</span></div><div><span>try to use the attribute  </span><a href="" name="servicestateid">$SERVICESTATEID$</a> 
(A number that corresponds to the current state of the service: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN.)</div><div><br></div><div>Best regards,</div><div>Mohamed<br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">De :</span></b> Net Warrior <netwarrior863@gmail.com><br> <b><span style="font-weight: bold;">À :</span></b> nagios-users@lists.sourceforge.net <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Jeudi 16 août 2012 13h28<br> <b><span style="font-weight: bold;">Objet :</span></b> [Nagios-users] My Own Command Deinifition Weird Behavior.<br> </font> </div> <br><div id="yiv1425910262">Hi there guys.<br><br>I defined my own command to use an internal sms sistems, so we can send an sms alert
 along with the e-mail ones.<br>This is what the script do.<br>#!/bin/bash<br><br>HOST=$1<br>STATE=$2<br>lynx <a rel="nofollow" target="_blank"  href="http://server:8888/SMSService/$HOST-State-$STATE">http://server:8888/SMSService/$HOST-State-$STATE</a><br>
<br>The command definition is:<br><br># send-sms<br>define command{<br>       command_name   send-sms<br>       command_line     /path/sms.sh $HOSTNAME$ $SERVICESTATE$<br>       }<br><br>The problem is that with some host I receive the SERVICESTATE condition, Ok or Critical, but with others dont, only get $<br>
As I can see on the debug file:<br><br>Processed notification command: /path/sms.sh server333 CRITICAL -> This is good<br>Processed notification command: /path/sms.sh server333 OK  -> This is good<br><br>But for the other servers I get:<br>
<br>Processed notification command: /path/sms.sh server222 $SERVICESTATE$ -> Only get the variable name instead its content, ok or critical.<br><br>Any idea what the problem could be?<br><br>Thanks in advance.<br>Best Regards<br>
<br><br><br><br>
</div><br>------------------------------------------------------------------------------<br>Live Security Virtual Conference<br>Exclusive live event will cover all the ways today's security and <br>threat landscape has changed and how IT managers can respond. Discussions <br>will include endpoint security, mobile security and the latest in malware <br>threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>_______________________________________________<br>Nagios-users mailing list<br><a ymailto="mailto:Nagios-users@lists.sourceforge.net" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>::: Please include Nagios version, plugin version (-v) and OS when reporting any
 issue. <br>::: Messages without supporting info will risk being sent to /dev/null<br><br> </div> </div>  </div></body></html>