opinkerfi / adagios

Adagios - Web Based Nagios Configuration
GNU Affero General Public License v3.0
327 stars 75 forks source link

notifications via SMS twillo #234

Closed vikashgounder closed 10 years ago

vikashgounder commented 10 years ago

Hi,

am having some issues when i managed to creating a new command to send sms via the twillo api.

define command { command_line /usr/bin/php /etc/nagios/sendTxtMsg.php $CONTACTPAGER$ "Notification Type: $NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SER VICESTATE$\nDate/Time: $LONGDATETIME$\nAdditional Info:\n$SERVICEOUTPUT$" command_name okc-notify-service-by-twillo }

If i run the command line it works fine, but via the nagios, it does not send SMS.

On the nagios logs, i noticed:

[1384317970] SERVICE NOTIFICATION: myemail@exmaple.com;myhostname.com;HTTPS HOSTNAME;CRITICAL;okc-notify-service-by-twillo;CRITICAL - Socket timeout after 10 seconds

Am i missing something... i also got the pager number right.

Grateful if someone can point me in the right direction.

Thanks Vikash

pall-valmundsson commented 10 years ago

Are you running the command in the command line as the nagios user? I've had similar issues in the past when I forgot that the checks don't run as root.

vikashgounder commented 10 years ago

actually m running the command as sudo -u nagios ... and i do get the text but somehow nagios is not sending the text.

as i mentioned before from the nagios logs, i can see okc-nofity-service-by-twillo is executed but i do not receive the text. Via the command i do get the text.

Is there any other logs or debugging i can do to see where the issue is happening...

Thanks Vikash

vikashgounder commented 10 years ago

Thanks Pall,

i managed to find out where the problem was, it is actually the limitation on twillo for 160 chars as m using the trial account and not passing message as unicode...

Maybe useful for other users.

they can also issue after the SMS account >> /tmp/test.out 2>&1to get some debugging information.

Appreciate your help and thanks.