[Nagios-users] My Own Command Deinifition Weird Behavior.

2012-08-16 Thread Net Warrior
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:/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@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

Re: [Nagios-users] My Own Command Deinifition Weird Behavior.

2012-08-16 Thread James Osbourn
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:netwarrior...@gmail.com]
Sent: 16 August 2012 13:29
To: nagios-users@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:/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@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

Re: [Nagios-users] My Own Command Deinifition Weird Behavior.

2012-08-16 Thread mohamed ben romdhane
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 netwarrior...@gmail.com
À : nagios-users@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:/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@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@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

Re: [Nagios-users] My Own Command Deinifition Weird Behavior.

2012-08-16 Thread Net Warrior
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_li...@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 netwarrior...@gmail.com
 *À :* nagios-users@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:/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@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@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@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