Out of curiosity, have you tried simply sending an email to your phone/pager/whatever-it-is? For example, a Sprint phone can recieve an SMS message sent to an email address like [EMAIL PROTECTED]

Paul


On Tue, 9 May 2006, Peter Shankland wrote:

Getting somewhere now. It looks as though the problem was with me not using
-q to supress the output from sms_client (thanks Phil Randal) but also the
nagios user not being able to write to /dev/ttyS0, /etc/ and /var/lock/

The problem I now have is that the plugin takes about 60 seconds to run,
but timesout after 30 seconds through Nagios. Is there a way to increase
this timeout period?

Thanks.

Pete.
----- Forwarded by Peter Shankland/RPL on 09/05/2006 18:10 -----
|---------+---------------------------->
|         |           Peter Shankland  |
|         |                            |
|         |           09/05/2006 17:44 |
|         |                            |
|---------+---------------------------->
 
>---------------------------------------------------------------------------------------------------------------------------------------------|
 |                                                                              
                                                               |
 |       To:      "Chad Osmond" <[EMAIL PROTECTED]>                             
                                                         |
 |       cc:      nagios-users@lists.sourceforge.net                            
                                                               |
 |       Subject: RE: [Nagios-users] SMS Text Message help(Document link: Peter 
Shankland)                                                     |
 
>---------------------------------------------------------------------------------------------------------------------------------------------|



When I run the following:

su - nagios sms_client vodafone_tap:123456789 "message"

I get:

/bin/sms_client: /bin/sms_client: cannot execute binary file

Is this starting to look like a permissions problem?

Thanks.


|---------+---------------------------->
|         |           "Chad Osmond"    |
|         |           <[EMAIL PROTECTED]|
|         |           urn.com>         |
|         |                            |
|         |           09/05/2006 17:03 |
|         |                            |
|---------+---------------------------->
 
>---------------------------------------------------------------------------------------------------------------------------------------------|
 |                                                                              
                                                               |
 |       To:       "Peter Shankland" <[EMAIL PROTECTED]>                        
                                                   |
 |       cc:                                                                    
                                                               |
 |       Subject:  RE: [Nagios-users] SMS Text Message help                     
                                                               |
 
>---------------------------------------------------------------------------------------------------------------------------------------------|




Try echoing the command into a tmp file, and then running it as the
nagios user.. Eg:

command_line   echo " /usr/bin/printf \"%b\" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n\" | /bin/sms_client vodafone_tap:$CONTACTADDRESS1$ " >
/tmp/sms-command`date +%s`

The "su - nagios"  and "sh /tmp/sms-command...." and see what happens.

My guess, from my experience last week is that there is either an error
with quotation marks, or the context.. By dumping the command to a temp
file you will be able to debug what is happening.

Good luck!

Chad


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Peter
Shankland
Sent: May 9, 2006 11:21 AM
To: nagios-users@lists.sourceforge.net
Subject: [Nagios-users] SMS Text Message help

I am successfully using the software from smsclient.org to send text
messages to mobile phones manually using the following command:

sms_client vodafone_tap:1234567890 "Message Text"

This work brilliantly but I have tried to integrate this into Nagios
with no success :(

I have created the following notification command within my
misccommands.cfg file:

# 'host-notify-by-sms' command definition define command{
       command_name    host-notify-by-sms
       command_line    /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n" | /bin/sms_client vodafone_tap:$CONTACTADDRESS1$
       }

I have then got the following within my contacts.cfg file:

define contact{
       contact_name                    1533
       alias                           Peter Shankland
       service_notification_period     24x7
       host_notification_period        24x7
       service_notification_options    w,u,c,r
       host_notification_options       d,r
       service_notification_commands   notify-by-email
       host_notification_commands
host-notify-by-email,host-notify-by-sms
       email                           [EMAIL PROTECTED]
       address1                        447977906721
       }

Finally, this gets called within one of my hosts.

I get the following within my syslog messages:

May  9 09:51:51 RPL-RENAULT nagios: HOST ALERT:
CISCO1200_RPL1-MO-1;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 0.60 ms
May  9 09:51:51 RPL-RENAULT nagios: HOST NOTIFICATION:
1533;CISCO1200_RPL1-MO-1;UP;host-notify-by-sms;PING OK - Packet loss =
0%, RTA = 0.60 ms May  9 09:51:51 RPL-RENAULT nagios: HOST NOTIFICATION:
1533;CISCO1200_RPL1-MO-1;UP;host-notify-by-email;PING OK - Packet loss =
0%, RTA = 0.60 ms

and the following within the Nagios Event Log:

[09-05-2006 09:51:51] HOST NOTIFICATION:
1533;CISCO1200_RPL1-MO-1;UP;host-notify-by-email;PING OK - Packet loss =
0%, RTA = 0.60 ms
[09-05-2006 09:51:51] HOST NOTIFICATION:
1533;CISCO1200_RPL1-MO-1;UP;host-notify-by-sms;PING OK - Packet loss =
0%, RTA = 0.60 ms

Everything appears to be working but I get no SMS text message. Am I
doing something obviously wrong as I simply want to run the command at
the top of this Email.

Thanks.

Pete.




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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











-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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


--
----------
# pwd
/loony/bin
----------



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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

Reply via email to