I'm using Zabbix 1.0 and have configured Zabbix to use the following script bellow through a pre sudo script that calls it (do to permissions).
The problem is that the script doesn't get the parameters (Send to, Subject and Body) from Zabbix, the $1 $2 $3 remains empty, I have tested it with manually entering the number and the SMS is sent but shows only Zabbix: -
Meaning that it does not get the parameters from Zabbix.
What am I doing wrong?
Any help will be appreciated
I'm using this script:
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
LOGFILE="/var/log/zabbix/sendsms.log"
echo "Recipient='$1' Subject='$2' Message='$3'" >> ${LOGFILE}
MOBILE_NUMBER=`echo "$1" | sed s#\s##`
# Log it
echo "echo 'Zabbix: $2 - $3' | /usr/bin/gnokii --sendsms '${MOBILE_NUMBER}'" >>${LOGFILE}
# Send it
echo "Zabbix: $2 - $3" | /usr/bin/gnokii --sendsms "${MOBILE_NUMBER}" 1>>${LOGFILE} 2>&1
# EOF
The problem is that the script doesn't get the parameters (Send to, Subject and Body) from Zabbix, the $1 $2 $3 remains empty, I have tested it with manually entering the number and the SMS is sent but shows only Zabbix: -
Meaning that it does not get the parameters from Zabbix.
What am I doing wrong?
Any help will be appreciated
I'm using this script:
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
LOGFILE="/var/log/zabbix/sendsms.log"
echo "Recipient='$1' Subject='$2' Message='$3'" >> ${LOGFILE}
MOBILE_NUMBER=`echo "$1" | sed s#\s##`
# Log it
echo "echo 'Zabbix: $2 - $3' | /usr/bin/gnokii --sendsms '${MOBILE_NUMBER}'" >>${LOGFILE}
# Send it
echo "Zabbix: $2 - $3" | /usr/bin/gnokii --sendsms "${MOBILE_NUMBER}" 1>>${LOGFILE} 2>&1
# EOF
Comment