I am in the process of creating a notify command for our Nagios server to notify us via our Kannel SMS sender.
This is what I got so far:
/usr/local/bin/curl -v -G -d 'username=user' -d 'password=pass' -d 'to='$CONTACTPAGER$'' --data-urlencode 'text=***** centreon *****\nType: '$NOTIFICATIONTYPE$'\nHost: '$HOSTNAME$'\nState: '$HOSTSTATE$'\nAddress: '$HOSTADDRESS$'\nInfo: '$HOSTOUTPUT$'\nDate/Time: '$DATE$'' 'http://192.168.11.248:13013/cgi-bin/sendsms' >> /tmp/nagios.notify
However, this won't work.. I never receive the text.
If I echo the whole command, like this:
echo "/usr/local/bin/curl -v -G -d 'username=user' -d 'password=pass' -d 'to='$CONTACTPAGER$'' --data-urlencode 'text=***** centreon *****\nType: '$NOTIFICATIONTYPE$'\nHost: '$HOSTNAME$'\nState: '$HOSTSTATE$'\nAddress: '$HOSTADDRESS$'\nInfo: '$HOSTOUTPUT$'\nDate/Time: '$DATE$'' 'http://192.168.11.248:13013/cgi-bin/sendsms'" >> /tmp/nagios.notify.debug
when checking the /tmp/nagios.notify.debug file, everything seems fine.
Do you have any idea why it won't work? Perhaps some troubleshooting steps I could make?
Also, running the command manually via SSH works just fine. So it is just when Nagios has to run it that it goes wrong.