My Own Command Deinifition Weird Behavior.

mohamed ben romdhane med_linux at yahoo.fr
Thu Aug 16 15:12:00 CEST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20120816/05bf4cc4/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