Home  >  Q&A  >  body text

linux - zabbix采用短信猫报警无法发送中文的问题

伊谢尔伦伊谢尔伦2742 days ago765

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-17 16:18:52

    I have figured out the cause of the problem. After checking the source code, I found that when zabbix calls SMS mode, it is indeed initialized. The code is as follows:
    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    , "+CMGS: "    , 40},    /* Send message */
        {NULL        , "OK"        , 1},    /* ^Z */
        {NULL        , NULL        , 0}
    };

    Text mode does not support Chinese, just change it to pdu mode.

    reply
    0
  • Cancelreply