linux - zabbix采用短信猫报警无法发送中文的问题
伊谢尔伦
伊谢尔伦 2017-04-17 16:16:52
0
1
800
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
刘奇

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template