My Own Command Deinifition Weird Behavior.

James Osbourn james.osbourn at citrix.com
Thu Aug 16 15:01:55 CEST 2012


The first thing that spring to mind is that the SMS script is being run for host alerts for which the service variable would not be defined.  It may be worth checking your contact notification definitions to make sure that hosts or services are different.

James

From: Net Warrior [mailto:netwarrior863 at gmail.com]
Sent: 16 August 2012 13:29
To: nagios-users at lists.sourceforge.net
Subject: [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



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