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.
SMS Gateway Issue
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: SMS Gateway Issue
It looks like it's having trouble passing the authentication through http, are you use the username/pass are correct? Have you contacted their team to see if someone has had this issue before with that script?
Re: SMS Gateway Issue
username/password are correct. using web browser I can logging to this address http://10.200.197.20:7474 and send smsslansing wrote:It looks like it's having trouble passing the authentication through http, are you use the username/pass are correct? Have you contacted their team to see if someone has had this issue before with that script?
no, i didn't contact them.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: SMS Gateway Issue
does your password have any special characters?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: SMS Gateway Issue
no. its pass@123Box293 wrote:does your password have any special characters?
Re: SMS Gateway Issue
Well, the script has syntax errors:
And I would assume those errors are responsible for the credentials not being passed correctly.
Have you contacted the vendor from the page you linked to inform them of the issue?
Code: Select all
/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" <<< )');"'Have you contacted the vendor from the page you linked to inform them of the issue?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.