Yes, you are right, after I fired the mail to the list, I checked that, my appologies, I notice that host uses HOSTSTATE and service uses SERVICESTATE, I changed that and defined two commands instead, gonna see if that fix the problem<br>
<br>service_notification_commands   send-sms-service,notify-service-by-email<br>host_notification_commands      send-sms-host,notify-host-by-email<br><br>command_line     /path/sms.sh $HOSTNAME$ $HOSTSTATE$<br>command_line     /path/sms.sh $HOSTNAME$ $SERVICESTATE$<br>
<br>Thank you vey much, sorry for the noise.<br>Best regards<br><br><div class="gmail_quote">2012/8/16 mohamed ben romdhane <span dir="ltr"><<a href="mailto:med_linux@yahoo.fr" target="_blank">med_linux@yahoo.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span>Hi,</span></div><div><span>try to use the attribute  </span><a name="1392f94ce8c9a3c8_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"> <hr size="1">  <b><span style="font-weight:bold">De :</span></b> Net Warrior <<a href="mailto:netwarrior863@gmail.com" target="_blank">netwarrior863@gmail.com</a>><br>
 <b><span style="font-weight:bold">À :</span></b> <a href="mailto:nagios-users@lists.sourceforge.net" target="_blank">nagios-users@lists.sourceforge.net</a> <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><div><div class="h5"> <br><div>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" href="http://server:8888/SMSService/$HOST-State-$STATE" target="_blank">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></div></div>------------------------------------------------------------------------------<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 href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">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></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 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></blockquote></div><br>