zabbix send sms example

[root@host scripts]# vim /etc/zabbix/scripts/sms.sh
#! /bin/sh

MAX_SMS=5

/bin/find /etc/zabbix/scripts/tmp/ -type f -mmin +60 -delete

files=`ls /etc/zabbix/scripts/tmp/ | wc -l`

if [ $files -lt $MAX_SMS ]; then
    subject=$3
    curl https://someprovider.com/exec.php --data "login=XXXX&password=xxxxxx&phones=xxxxxx&rus=1&message=$subject"
    logger "zabbix: message has been sent - $3"
else
logger "SMS more than $MAX_SMS"
fi

echo $3 > /etc/zabbix/scripts/tmp/`date +%F_%T`

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>