[ZBX-3507] Triple SMS for each trigger action Huawei E1752 Created: 2011 Feb 04 Updated: 2017 May 30 Resolved: 2015 Mar 27 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 1.8.4 |
Fix Version/s: | 2.0.15rc1, 2.2.10rc1, 2.4.5rc1, 2.5.0 |
Type: | Incident report | Priority: | Major |
Reporter: | mof | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 6 |
Labels: | sms | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Linux Debian Lenny i386 |
Issue Links: |
|
Description |
Whenever I have an sms action Zabbix send out three sms'. Discussion and more details in forum thread. gammu identify |
Comments |
Comment by richlv [ 2011 Feb 07 ] |
it sounds like zabbix interpreting modem response as an error, but modem still sending the message. if you run server with debuglevel4, what communication can be seen there when sending the messages ? |
Comment by Admin [ 2011 Mar 16 ] |
I'm having the same issue with the triple SMS messages. But with a different distro and different modem version. I'm fairly new with zabbix, how would I go about settings the server into debug level 4? I don't recall seeing it in any config files. Also where would the log file be stored on the server? Thanks. |
Comment by mof [ 2011 Apr 05 ] |
To set the server to debug level 4, edit your zabbix_server.conf (or whatever you called it) and set DebugLevel=4, Then it should print out a whole lot more of information. Also make sure you have defined a logfile eg. LogFile=/var/log/zabbix/zabbix_server.log in zabbix_server.conf When I set debug to lvl 4, I get too much information to see spot any usefull information. Currently about 2-3M a seconds. Any suggestions for what I can grep after ? |
Comment by Märt Reose [ 2012 Mar 08 ] |
I am having the same problem, so I set in my conf: And then restarted the server. Now I killed the zabbix agent process on one of the servers to get an action triggered. On Dashboard it shows Details: SMS, Status: Not Sent. I am using the built in SMS function not a script. And yet I got 3 sms saying that the server has failed... Contents of my log file: Also the USB device is /dev/ttyUSB0 Modem: Huawei E220 |
Comment by Roberto Alcantara [ 2012 May 04 ] |
I have some problem, but i`m running CENTOS 5. |
Comment by Admin [ 2012 May 04 ] |
I had this too on: I don't know if it's still the same on 1.8.11 as I've seen used an external script instead. |
Comment by Admin [ 2012 Jun 12 ] |
Just a note. I've start a completely fresh build on Centos 6.2 32bit with zabbix 2.0 and the same Huawei E220. We still get the triple SMS problem. |
Comment by Marcelo [ 2012 Jul 02 ] |
I had the same problem on: Zabbix server v2.0.0 (revision 27675) (21 May 2012) CentOS release 6.2 (Final) BST 2012 x86_64 x86_64 x86_64 GNU/Linux USB Modem HUAWEI E220. |
Comment by mof [ 2012 Jul 24 ] |
I'm thinking a cause of this problem could be related to the SMS modem is so slow sending message. Does anybody know where in the code to look for the SMS action ? Best |
Comment by Admin [ 2012 Jul 24 ] |
I believe it's \src\zabbix_server\alerter\alerter.c else if (MEDIA_TYPE_SMS == mediatype->type) { /* SMS uses its own timeouts */ res = send_sms(mediatype->gsm_modem, alert->sendto, alert->message, error, max_error_len); }No idea where it stores it's own timeout. I think another solution could be to change the alert.retries in the db. But I have absolutely not idea how. |
Comment by mof [ 2012 Dec 23 ] |
I just upgraded to latest Zabbix 2.0.4, now no SMS is sent out and I get the following error in event details: This error also occured in Zabbix 2.0.0. I don't think is related to the upgrade, because it stopped working suddenly - after upgrading from 1.8.x to 2.0.0 I still got triple sms's. |
Comment by Vladimir [ 2013 Nov 25 ] |
To resolve this problem, I edit sms.c file and then rebuild rpm package. zbx_sms_scenario scenario[] = { {ZBX_AT_ESC , NULL , 0}, /* Send <ESC> */ {"AT+CMEE=2\r" , ""/*"OK"*/ , 5}, /* verbose error values */ {"ATE0\r" , "OK" , 5}, /* Turn off echo */ {"AT\r" , "OK" , 5}, /* Init modem */ {"AT+CMGF=1\r" , "OK" , 5}, /* Switch to text mode */ {"AT+CMGS=\"" , NULL , 0}, /* Set phone number */ {number , NULL , 0}, /* Write phone number */ {"\"\r" , "> " , 5}, /* Set phone number */ {message , NULL , 0}, /* Write message */ {ZBX_AT_CTRL_Z , "" , 40}, /* Send message */ {NULL , "+CMGS: " , 5}, {NULL , "" , 5}, {NULL , "" , 1}, /* ^Z */ {NULL , NULL , 0} }; This code resolve the problem. |
Comment by Aleksandr Ljutsko [ 2014 Oct 07 ] |
Please, fix the bug (source sms.c) and rebuild official packages (Debian, RH) on http://repo.zabbix.com enviroment: modem Huawei E173, OS: Centos 6.5 |
Comment by Aleksandrs Saveljevs [ 2015 Mar 25 ] |
raivon, do I understand correctly that the reasoning behind your patch is that Huawei modems do not output "OK" after "+CMGS: " line? If so, would you classify that as proper behavior for a self-respecting modem? |
Comment by E. Ranta [ 2015 Mar 26 ] |
When do you plan to fix it ? Almost five years.. without NOTHING! |
Comment by Aleksandrs Saveljevs [ 2015 Mar 26 ] |
eranta, one way you could help this issue is by providing the DebugLevel=4 log of the alerter process that catches the problematic SMS sending process. Note that since 2.4.0 you can change logging level at runtime, see http://blog.zabbix.com/zabbix-2-4-features-part-6-runtime-loglevel-changing/. Another way you could help is by trying to send an SMS using AT commands on your modem, the same way Zabbix does it (see src/libs/zbxmedia/sms.c), and posting here the dialog between you and the modem, together with the timing between your commands and modem responses, and together with conjectures on what might be the cause of the problem. Yet another way is simply showing us the error message that appears in the "Info" column for non-sent SMS messages. |
Comment by Aleksandrs Saveljevs [ 2015 Mar 26 ] |
In any case, the problem seems to be that after Zabbix completes its AT+CMGS command with ^Z, Huawei immediately replies with CR, but the response line containing "+CMGS: " is only output after a bit of time. Since we expect to read a reply to a command in one go, rather than in several steps spread in time, we consider SMS sending as failed, while it has actually been sent successfully. |
Comment by Aleksandrs Saveljevs [ 2015 Mar 26 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-3507 (2.0) by trying to read modem response until we have a printable character, which would indicate a response to a command. |
Comment by Aleksandrs Saveljevs [ 2015 Mar 27 ] |
Fixed in pre-2.0.15 r52909, pre-2.2.10 r52910, pre-2.4.5 r52911, pre-2.5.0 (trunk) r52912. |
Comment by Oleksii Zagorskyi [ 2015 Oct 03 ] |
It caused |