SMS Gateway Issue
Posted: Tue Nov 11, 2014 1:12 pm
Hi !
I’m configured nagios core to send sms notifications using this article.
http://www.sms-integration.com/how-to-s ... s-110.html
Its working fine but I’m using Ozeki NG SMS Gateway 20 day trial software. I already have registered version of Now SMS/MMS Gateway v2013.11.15 sofware. So I need to use it for sending nagios notifications.
I used this shell script for send sms notifications through the Ozeki NG SMS Gateway and its working well
#!/bin/bash
url1="http://10.238.81.55:9501/api?action=sendmessage&username=admin&password=pass@123&recipient=0123456789&messagetype=SMS:TEXT&messagedata="
url2="$@"
url2+=$(php -r "echo rawurlencode('$(sed "s/'/\\\\'/g" <<< )');")
url=$url1+$url2
wget -O- "$url"
actually I haven’t good knowledge for shell scripting. I simply change URL,port no, username,password,phone number in above shell script according to my Now SMS/MMS Gateway settings.
#!/bin/bash
url1="http://10.200.197.20:7474/api?action=sendmessage&username=admin&password=pass@123&recipient=0123456789&messagetype=SMS:TEXT&messagedata="
url2="$@"
url2+=$(php -r "echo rawurlencode('$(sed "s/'/\\\\'/g" <<< )');")
url=$url1+$url2
wget -O- "$url"
when I execute this script its showing below message
[root@localhost ~]# /usr/local/nagios/libexec/sms_send.sh
/usr/local/nagios/libexec/sms_send.sh: command substitution: line 5: syntax error near unexpected token `)'
/usr/local/nagios/libexec/sms_send.sh: command substitution: line 5: `sed "s/'/\\\\'/g" <<< )');"'
--2014-11-11 22:45:50-- http://10.200.197.20:7474/api?action=se ... sagedata=+
Connecting to 10.200.197.20:7474... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.
Please can someone help me to resolve this issue.
I’m configured nagios core to send sms notifications using this article.
http://www.sms-integration.com/how-to-s ... s-110.html
Its working fine but I’m using Ozeki NG SMS Gateway 20 day trial software. I already have registered version of Now SMS/MMS Gateway v2013.11.15 sofware. So I need to use it for sending nagios notifications.
I used this shell script for send sms notifications through the Ozeki NG SMS Gateway and its working well
#!/bin/bash
url1="http://10.238.81.55:9501/api?action=sendmessage&username=admin&password=pass@123&recipient=0123456789&messagetype=SMS:TEXT&messagedata="
url2="$@"
url2+=$(php -r "echo rawurlencode('$(sed "s/'/\\\\'/g" <<< )');")
url=$url1+$url2
wget -O- "$url"
actually I haven’t good knowledge for shell scripting. I simply change URL,port no, username,password,phone number in above shell script according to my Now SMS/MMS Gateway settings.
#!/bin/bash
url1="http://10.200.197.20:7474/api?action=sendmessage&username=admin&password=pass@123&recipient=0123456789&messagetype=SMS:TEXT&messagedata="
url2="$@"
url2+=$(php -r "echo rawurlencode('$(sed "s/'/\\\\'/g" <<< )');")
url=$url1+$url2
wget -O- "$url"
when I execute this script its showing below message
[root@localhost ~]# /usr/local/nagios/libexec/sms_send.sh
/usr/local/nagios/libexec/sms_send.sh: command substitution: line 5: syntax error near unexpected token `)'
/usr/local/nagios/libexec/sms_send.sh: command substitution: line 5: `sed "s/'/\\\\'/g" <<< )');"'
--2014-11-11 22:45:50-- http://10.200.197.20:7474/api?action=se ... sagedata=+
Connecting to 10.200.197.20:7474... connected.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.
Please can someone help me to resolve this issue.