ODT Export
 
SMS with Gnokii

If you have a working gnokii sms gateway (for example: a bluetooth phone connected to the zabbix server) you can use it the following way:

Create an sms script (and make it executable) on the zabbix server in the AlertScriptsPath (=/etc/zabbix/alert.d/ on ubuntu)

#!/bin/sh
HOME=/etc
PATH=/bin:/sbin:/usr/bin:/usr/sbin
LOGFILE="/var/log/zabbix-server/zabbix-sms.log"
 
echo "Recipient='$1' Message='$3'" >> ${LOGFILE}
 
MOBILE_NUMBER=`echo "$1" | sed s#\s##`
 
# Log it
echo "echo $3 | /usr/bin/sudo /usr/bin/gnokii --sendsms ${MOBILE_NUMBER}" >>${LOGFILE}
 
# Send it
echo "$3" | /usr/bin/sudo /usr/bin/gnokii --sendsms "${MOBILE_NUMBER}" 1>>${LOGFILE} 2>&1
 
# EOF

(credits for script: http://www.zabbix.com/forum/showthread.php?p=45240 , http://www.zabbix.com/forum/member.php?u=4196, I only added the sudo, and added zabbix ALL = NOPASSWD:/usr/bin/gnokii to the sudoers to make it available for the zabbix user)

Configure a media type (menu administration) with the same name as your script (without path, without parameters)

Link this media type to a user (menu administration) and use the phone number (i.e. 31600000000) as Send to parameter.

 
howto/config/alerts/sms.txt · Last modified: 2010/02/05 19:32 by richlv
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki