Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.