====== Zabbix + GSM brĂ¡na (RS232) ======
Nastroje v linuxu:
* gnokii ([[https://www.zabbix.com/wiki/howto/config/alerts/sms]])
* AT prikazy ({{ :wiki:ostatni:zabbix:odeslani_sms_pomoci_at_prikazu_z_terminalu.doc |}})
#!/bin/sh
HOME=/etc
PATH=/bin:/sbin:/usr/bin:/usr/sbin
LOGFILE="/var/log/zabbix/zabbix-sms.log"
echo "Recipient='$1' Message='$3'" >> ${LOGFILE}
#MOBILE_NUMBER=`echo "$1" | sed s#\s##`
MOBILE_NUMBER="$1"
# Log it
echo "echo $3 | /usr/bin/sudo /usr/bin/gnokii --config /etc/gnokiirc --sendsms ${MOBILE_NUMBER} --validity 4320" >>${LOGFILE}
# Send it
echo "$3" | /usr/bin/sudo /usr/bin/gnokii --config /etc/gnokiirc --sendsms "${MOBILE_NUMBER}" --validity 4320 1>>${LOGFILE} 2>&1
echo "\n" >> ${LOGFILE}
# EOF
#!/bin/sh
HOME=/etc
PATH=/bin:/sbin:/usr/bin:/usr/sbin
LOGFILE="/var/log/zabbix/zabbix-call.log"
echo "$(date +'%Y.%m.%d-%H:%M:%S')" "Recipient='$1'" >> ${LOGFILE}
#MOBILE_NUMBER=`echo "$1" | sed s#\s##`
MOBILE_NUMBER="$1"
# Log it
echo /usr/bin/sudo /usr/bin/gnokii --config /etc/gnokiirc --dialvoice ${MOBILE_NUMBER} >>${LOGFILE}
# Call
/usr/bin/sudo /usr/bin/gnokii --config /etc/gnokiirc --hangup 0 1>>${LOGFILE} 2>&1
/usr/bin/sudo /usr/bin/gnokii --config /etc/gnokiirc --dialvoice "${MOBILE_NUMBER}" 1>>${LOGFILE} 2>&1
echo "\n" >> ${LOGFILE}
# EOF