My Own Command Deinifition Weird Behavior.

Net Warrior netwarrior863 at gmail.com
Thu Aug 16 15:30:07 CEST 2012


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

service_notification_commands   send-sms-service,notify-service-by-email
host_notification_commands      send-sms-host,notify-host-by-email

command_line     /path/sms.sh $HOSTNAME$ $HOSTSTATE$
command_line     /path/sms.sh $HOSTNAME$ $SERVICESTATE$

Thank you vey much, sorry for the noise.
Best regards

2012/8/16 mohamed ben romdhane <med_linux at yahoo.fr>

> Hi,
> try to use the attribute  $SERVICESTATEID$  (A number that corresponds to
> the current state of the service: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN.)
>
> Best regards,
> Mohamed
>   ------------------------------
> *De :* Net Warrior <netwarrior863 at gmail.com>
> *À :* nagios-users at lists.sourceforge.net
> *Envoyé le :* Jeudi 16 août 2012 13h28
> *Objet :* [Nagios-users] My Own Command Deinifition Weird Behavior.
>
> Hi there guys.
>
> I defined my own command to use an internal sms sistems, so we can send an
> sms alert along with the e-mail ones.
> This is what the script do.
> #!/bin/bash
>
> HOST=$1
> STATE=$2
> lynx http://server:8888/SMSService/$HOST-State-$STATE
>
> The command definition is:
>
> # send-sms
> define command{
>        command_name   send-sms
>        command_line     /path/sms.sh $HOSTNAME$ $SERVICESTATE$
>        }
>
> The problem is that with some host I receive the SERVICESTATE condition,
> Ok or Critical, but with others dont, only get $
> As I can see on the debug file:
>
> Processed notification command: /path/sms.sh server333 CRITICAL -> This is
> good
> Processed notification command: /path/sms.sh server333 OK  -> This is good
>
> But for the other servers I get:
>
> Processed notification command: /path/sms.sh server222 $SERVICESTATE$ ->
> Only get the variable name instead its content, ok or critical.
>
> Any idea what the problem could be?
>
> Thanks in advance.
> Best Regards
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120816/02e25ed5/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-------------- 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