Ad Widget

Collapse

Zabbix SMS Patch needed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akox
    Junior Member
    • Sep 2006
    • 7

    #1

    Zabbix SMS Patch needed

    Hello all,

    I have a problem with zabbix 1.1.2 and SMS notifications. Sometimes I get the message "Read something unexpected from GSM modem" and the SMS is sent twice.
    I've traced the problem down to this:
    Some times the GSM modem responds too quickly and the sms.c of zabbix gets 2 lines from the modem as 1 line, and so it doesn't get any input when it expects so.

    When the problem happens i get these 2 lines on the debug file:
    002065:20061124:103236 Read buffer [^M+CMGS: 192^M^MOK^M]
    002065:20061124:103242 Read buffer []

    When the sms is sent without problem i get these 2 lines:

    002065:20061124:103325 Read buffer [^M+CMGS: 193^M]
    followed by
    002065:20061124:103325 Read buffer [^MOK^M]

    If we look at the code we have:

    At line 156 of src/libs/zbxsms/sms.c
    if(ret == SUCCEED)
    ret = read_gsm(f,"\r+CMGS: ", error, max_error_len);
    if(ret == SUCCEED)
    ret = read_gsm(f,"OK\r", error, max_error_len);

    But to fix this problem one must modify the read_gsm function!!!
    The fix should probably be to check if the buffer has grabbed more than 1 line at a time. If so, then it should check only the first line and keep the other lines in a private buffer to check them one at a time in each next call.

    Is there anyone willing to write the patch?

    --------------
    I forgot to mention that the problem isn't specific to zabbix 1.1.2. Newer versions have the same problem as well. (sms.c is the same on 1.1.2, 1.1.3 and 1.1.4)
    Last edited by akox; 24-11-2006, 15:17. Reason: addition for other versions of zabbix
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    It has been fixed in a different way. The fix will be available in 1.1.5.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    Working...