Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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$'' '' >> /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$'' ''" >> /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

Your Answer


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

Browse other questions tagged or ask your own question.