I gave up on zabbix SMS function and this is what i use.
For linux. (iam using centos 5)
How to send SMS from mobilephone that supports AT commands for SMS (all phons don't do it)
This is how I do it.
1. Install http://pxh.de/fs/gsmlib/download/index.html
2. insert you USB cable from your phone (ex. Ericsson M600i )into your linux server runnin zabbix.
3. cat /var/log/messages and check what the Phone interface will be.
(ex.
Feb 4 11:48:14 netscan kernel: usb 2-1: new full speed USB device using uhci_hcd and address 7
Feb 4 11:48:14 netscan kernel: usb 2-1: configuration #1 chosen from 1 choice
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.1: ttyACM0: USB ACM device
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.3: ttyACM1: USB ACM device
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.5: ttyACM2: USB ACM device
)
4. now you know your phone is connected via ttyACMx (x=0-2, mine was 1 (depends on the USB port ya connect to. ))
5. now time to send a SMS..
gsmsendsms -d /dev/ttyACM1 -b 115200 +ccmmmmmm "fableman made my day"
(cc=your county code .ex +46 for sweden) mm=your mobile phone (and remove the first 0 if any)
soo...
gsmsendsms -d /dev/ttyACM1 -b 115200 +46701234567 "fableman made my day"
(will send a sms to a swedish mobile phone at 070-1234567)
To inplement into zabbix..
1. EDIT /etc/zabbix/zabbix_server.conf
AlertScriptsPath=/etc/zabbix/externalscripts/
2. put this example scriopt into etc/zabbix/externalscripts/
#!/bin/sh
/usr/bin/gsmsendsms -d /dev/ttyACM1 -b 115200 $1 "$2 $3 $4 $5 $6 $7 $8 $9"
3. chmod zabbix:root /etc/zabbix/externalscripts/*
chown u+x /etc/zabbix/externalscripts/*
4. restart zabbix
5. in zabbix create a new Media and select script
send to yout mobile phone number
Hope this small fast guide helped anyone.
Maybee there is other ways but works for me
Hint: The script I included should be modify to handle lots of inc SMS same time... a que system.. (Iam doing it my self at the moment) let me know if ya need it later.
For linux. (iam using centos 5)
How to send SMS from mobilephone that supports AT commands for SMS (all phons don't do it)
This is how I do it.
1. Install http://pxh.de/fs/gsmlib/download/index.html
2. insert you USB cable from your phone (ex. Ericsson M600i )into your linux server runnin zabbix.
3. cat /var/log/messages and check what the Phone interface will be.
(ex.
Feb 4 11:48:14 netscan kernel: usb 2-1: new full speed USB device using uhci_hcd and address 7
Feb 4 11:48:14 netscan kernel: usb 2-1: configuration #1 chosen from 1 choice
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.1: ttyACM0: USB ACM device
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.3: ttyACM1: USB ACM device
Feb 4 11:48:14 netscan kernel: cdc_acm 2-1:1.5: ttyACM2: USB ACM device
)
4. now you know your phone is connected via ttyACMx (x=0-2, mine was 1 (depends on the USB port ya connect to. ))
5. now time to send a SMS..
gsmsendsms -d /dev/ttyACM1 -b 115200 +ccmmmmmm "fableman made my day"
(cc=your county code .ex +46 for sweden) mm=your mobile phone (and remove the first 0 if any)
soo...
gsmsendsms -d /dev/ttyACM1 -b 115200 +46701234567 "fableman made my day"
(will send a sms to a swedish mobile phone at 070-1234567)
To inplement into zabbix..
1. EDIT /etc/zabbix/zabbix_server.conf
AlertScriptsPath=/etc/zabbix/externalscripts/
2. put this example scriopt into etc/zabbix/externalscripts/
#!/bin/sh
/usr/bin/gsmsendsms -d /dev/ttyACM1 -b 115200 $1 "$2 $3 $4 $5 $6 $7 $8 $9"
3. chmod zabbix:root /etc/zabbix/externalscripts/*
chown u+x /etc/zabbix/externalscripts/*
4. restart zabbix
5. in zabbix create a new Media and select script
send to yout mobile phone number
Hope this small fast guide helped anyone.
Maybee there is other ways but works for me
Hint: The script I included should be modify to handle lots of inc SMS same time... a que system.. (Iam doing it my self at the moment) let me know if ya need it later.


Comment