1. 安装飞实现服务器故障发送短信报警
    将最新版本的fetion主程序放在一个目录下面,并将其使用的库文件也放在同一目录
    我这里放在/usr/local/下面,并给四个Lib开头的库文件755权限
    在/etc/ld.so.conf中添加/usr/local/文件路径,并使用ldconfig重新加载一下
     
    然后执行命令测试飞信是否能正常发送短信
    [root@test local]# LD_LIBRARY_PATH=. ./fetion --mobile=13917494xxx --pwd=xxxxxxx --to=1871777xxxxx --msg-utf8=测试nagios报警消息
     
    Mobile是自己的手机号,pwd是自己飞信密码 to指定接收短信者(必须是自己好友)
    --msg-uft8是短信内容,注意不能太长,否则会拆分成多条消息
     
    第一次发送的时候会提示输入验证码,这个验证保存在当前主程序目录下面,并以自己的手机号命名的一个图片,也就是我上图中紫色的图片

     

    用windows客户端打开图片,输入里面的验证码
     

  2. [root@test local]# LD_LIBRARY_PATH=. ./fetion --mobile=1391749xxxx --pwd=xxxxxxxx --to=1871777xxxx --msg-utf8=测试nagios报警消息
    HTTP/1.1 200 OK
    Connection: close
    Date: Thu, 30 Aug 2012 08:31:37 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Content-Length: 2417

  3. <?xml version="1.0" encoding="UTF-8"?><results><pic-certificate id="663cef5a-047c-4526-8678-9e553fad0a3d" pic="/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAkAFoDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFD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xWOv6VdSIhkZILyNyqDqxAPAHrXz74EWJYPE/w08UWt3PCjtJCbeFp2tZFO1pFC/MRkow2jnnIwTS/Cnxpf+DdW1HwaYIr6W4nxY4lCR/aMheWPRCME8bhtxgk4oWui6q68wenyep7/ZeLfDWo3cdpY+IdJurmTISGC9jd2wM8KGyeBWzXOeFvB9j4cFxdmOKfWL12mvr7ywGldzuYL/dTPRfbnJya6OmwCiiikBFcrO1tItrJHFOVIjeWMuqt2JUFSR7ZH1rznQPhvquheOtR16e+0/VYNYSSO/jeFrfywzA/u1zIHHBGGI47mvS6KLa3B7WPB5/hV488NQ+ILbwhq9vHpd7IJbeCK7khuF2tkAHbgHGVPzDIxk8Yq9411XX5PhnbeEbDRfEWqavPDHb3t3Lp8u1CpG/MmCrkkY3KWXGTuPf2qila65Xt/kO+vMtzkPhj4Zu/CPgLT9KvyPtg3SzIGyEZ2J25HBxkDjjOa5k/D7xCPjBc+MdKurPTrWQGN47oGZpfkCk7EIG0kAj5wQRkjtXqtFU3eXMSl7vKeO+MbbwR4V8TXGuXl6b3xdezILeJ777OLdiAoLGLbsi2kZL5JA6nmub+L3hDT7Tw5Y+JE1+CfxEzi4lne6CNeocfNCueiZXaF6L6nk/Q1FTbT0Kvrc8l+GXj7VvEuhRlL2z1TUIFIubCdhBcgDA3owG11OR1UYJwWPU+hWXiXT7u6Wzm82wv26Wl6nlyN/u/wyD3QsPelg8K+HbXUBqFvoOlxXocuLmOzjWQMep3AZycnn3rQu7K01C3Nve2sNzCSCY5ow6k/Q8VTd9SUraE9FFFIYUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//2Q==" /></results>
    图形验证码已经生成,文件名为:13917494356.jpg请识别后输入图形验证码:
    R5hX
    您输入的识别码是:R5hX
    SIP-C/4.0 280 Send SMS OK
    T: sip:344133809@fetion.com.cn;p=15278
    I: 3
    Q: 1 M
    L: 114
    D: Thu, 30 Aug 2012 08:33:05 GMT
    XI: 0EDF7A2CE119D38879641FDB579F3397