Ad Widget

Collapse

Zabbix sends 3 sms instead of 1 and also event error: Expected [+CMGS: ] received []

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • verus
    Member
    • Feb 2009
    • 67

    #1

    Zabbix sends 3 sms instead of 1 and also event error: Expected [+CMGS: ] received []

    Hi,

    I have zabbix 2.0.3 and I want to use SMS notifications.
    For that I use a Novatel USB modem which works fine (/dev/ttyUSB3)
    I can also sent an sms from command line without a problem.

    So, everything is setup and configured in Zabbix and when the item is triggered, I get my e-mail as configured and also my sms notification(s).

    The problem is that I get 3 sms notifications and in the events details I can see the following error:
    Expected [+CMGS: ] received []

    So I think that zabbix is sending the sms but not receiving feedback and that it tries that 3 times and then the error is created ?
    However, I receive the sms notification 3 times, which I don't want of course.

    This is not a problem of escalation, all that is configured correctly (STEP FROM 1 TO 1 and only sent to 1 user with 1 phone number).

    How can I correct this ?
    thanks.
  • Prometej
    Junior Member
    • Oct 2010
    • 21

    #2
    FILE sms.c
    Code:
    #define>ZBX_AT_ESC<---->"\x1B"
    #define ZBX_AT_CTRL_Z<->"\x1A"
    
    <------>zbx_sms_scenario scenario[] =
    <------>{
    <------><------>{ZBX_AT_ESC<--->, NULL<><------>, 0},<->/* Send <ESC> */
    <------><------>{"AT+CMEE=2\r"<>, ""/*"OK"*/<-->, 10},<>/* verbose error values */
    <------><------>{"ATE0\r"<----->, "OK"<><------>, 10},<>/* Turn off echo */
    <------><------>{"AT\r"><------>, "OK"<><------>, 10},<>/* Init modem */
    <------><------>{"AT+CMGF=1\r"<>, "OK"<><------>, 10},<>/* Switch to text mode */
    <------><------>{"AT+CMGS=\""<->, NULL<><------>, 0},<->/* Set phone number */
    <------><------>{number><------>, NULL<><------>, 0},<->/* Write phone number */
    <------><------>{"\"\r"><------>, "> "<><------>, 10},<>/* Set phone number */
    <------><------>{message<------>, NULL<><------>, 0},<->/* Write message */
    <------><------>{ZBX_AT_CTRL_Z<>, ""<--><------>, 20},<>/* Send message */
    <------><------>{NULL<-><------>, "+CMGS: "<--->, 30},
    <------><------>{NULL<-><------>, ""<--><------>, 10},
    <------><------>{NULL<-><------>, ""<--><------>, 5},<->/* ^Z */
    <------><------>{NULL<-><------>, NULL<><------>, 0}
    <------>};
    
    <------>zbx_sms_scenario<------>*step = NULL;
    <------>struct termios<><------>options, old_options;
    <------>int<---><------><------>f, ret = SUCCEED;
    Edit as I have in the code file sms.c.
    Recompile zabbih server and the problem is still with the three-error sending SMS (although sent 3 SMS) should disappear. Good luck to you.

    manual AT command from GSM Modems

    Comment

    Working...