Hi All,
I am trying to get Nagios to send SMS through an SMS webservice running
on a Windows server.
I can send a message through curl for example so I know it works ok.
For the moment, I just want to be able to send an SMS when a host is no
longer available/reachable.
I have been experimenting but it's not working properly (or sometimes
not at all)
I suddenly got one notification by email over a one day period but no
SMS at all.
Ultimately, I want to send both an email notification and an SMS at the
same time. Once I get it figured out, I would like to do the same for
defined services.
My modified 'notify-host-by-email' command is as follows:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" |
/usr/local/nagios/etc/celtelconfig/send-mail-sms-alerts.sh
}
The sendsmsalerts.sh script is as follows:
#!/bin/sh
# called by notify-host-by-email
read INPARAM
MESSAGE="appCode=Nagios&fromNumer=NAGIOS&toNumber=2348013556519&shortMes
sage=$INPARAM"
curl -d $MESSAGE
http://sms-server/smswebservice/smsservice.asmx/SendMessage
a sample working curl message is of the form:
curl -d
"appCode=Nagios&fromNumer=NAGIOS&toNumber=2348013556519&shortMessage=Nag
ios Calling at 1:41PM"
http://sms-server/smswebservice/smsservice.asmx/SendMessage
DISCLAIMER: This email and any attachments are confidential and privileged. It
is intended solely for the addressee. Access to this email by anyone else is
unauthorized. If received in error, do not open, read, copy, disclose, use or
store it in any way, or permit others to do so but please notify the sender
immediately and delete the original email and attachments from your machine. If
you are not the addressee or the intended recipient, any use, disclosure,
copying, distribution or action taken in reliance of it, is prohibited and
unlawful. The information, attachments, opinions or advice contained in this
email are not necessarily the views or opinions of Celtel Nigeria Limited or
its affiliates and without more, shall not commit Celtel Nigeria Limited or its
affiliates. Celtel Nigeria Limited and its affiliates do not accept liability
for claims, losses, or damages caused by the inaccuracy, incorrectness, or lack
of integrity of this email or any attachments.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
[email protected]
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