配置nagios和nconf使用短信报警

一:修改飞信短信及邮件相关报警信息
(1)登录http://IP/nconf
(2)修改信息接收短信的手机号及接收邮件的Email地址
clip_image002clip_image004

clip_image006注意:好多邮箱要将域名cnyunwei.com-Cacti加入到白名单,否则会被拦截。见下图我的QQ邮箱。

clip_image008

看我的邮箱收的邮件

clip_image010

二:修改发报警短信的飞信机器人登录帐号
(注意:必须是以手机号注册的飞信号才可以发短信,可以给好友发短信也可自己给自己发,但是一般不用你自己手机注册的飞信号来发,除非你不在电脑上使用飞信;可以用一个平时不用飞信的手机号来注册,然后把你加为好友,这样就可以给你发短信报警了,以Email方式注册的不能发短信)
clip_image012修改notify-host-by-fetion及notify-service-by-fetion,修改里面的sid号及pwd密码--sid=534**** --pwd=cnyunwei.com***,如果不方便修改可以把全部内容复制到记事本上修改后再粘贴回去,注意全部内容都在一行的;
clip_image014三:报警策略设置
clip_image016

都修改完后,点击Generate Nagios config

clip_image018

执行脚本,看到2个done后,OK。

clip_image020

四:发短信测试

第一次给手机发短信,需要按如下操作输入验证码

[root@cnyunwei fetion]# pwd

/usr/local/fetion

[root@cnyunwei fetion]# ls

fetion

[root@cnyunwei fetion]# /usr/local/fetion/fetion --sid=659****** --pwd=******* --to=13522****** --msg-type=1 --msg-utf8="cnyunweiw.com报警测试"

HTTP/1.1 200 OK

Connection: close

Date: Thu, 28 Jun 2012 09:18:24 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: 2261

<?xml version="1.0" encoding="UTF-8"?><results><pic-certificate id="004c31b4-f079-4524-80b9-68248caaefd4" pic="/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjI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XttD02fSLJijCNGSWZguSAWlwoxgk4YjIwGpvZtf15gr6f18j1HSvFGha3N5GnataT3IUs9sJAJ4wDg74zh1IPBBAIPWtevljwuZNfg8aeLDPr1hqVx5j2cmlQXDKH5kKNLGhAX7gIJAwc+hFrS9Q0zxH8HdYufEWmXeo6ravIq6xI0ZkjOAY1MsjhiMnGwZz2BJFJ6LzSuPd2Wzdj6dorx/4N/8Jtb+AIImsrZrV5C9nLqF06MkJAxtQISVzkjLLweOMV6Cun+Jp2ButftYFzyllYYP03SO+f8AvkU5KzsSndXN+iiikMhupnt7WSaO2luXQZWGEqHc+g3ELn6kCuH8F6rd3HjDxONS0HV9NnurpGga5tWMbRJGFA81cx5ypP3sHdwTzXfUULe4PY+a/iN4XvvBfxFW70Q+Tp/iUPaOqj5VMvyyJgdvmDD3+lek2us+IdA+Jeow+JdVtrHwkLcHT2uFSOFj8oVRKQMOMPlWbJ6gEcj0S6srS+SNLu1huFjkWVBNGHCuvRhnoR2NT0R91Jdr/d/wOgS1d/6v/wAHS583JeS+PPjbqSeGPOGi3sBtdQngUqkkRjKtI/GCcn5c8kgV0VlpPjHwR8Lde8MR+Gri9mJkW2v7CWORZFkwGby9wk3AHgBT+AGa9voqeW0eXyt+o7+9zed/0PPvhBo0emfDS206eKWK7cyNeQzQtFIjsTwysAfu7ee/UcV5f8FW8Maf4v1vR9YXS5LqO6T+zZ7pEZi6Oy4jcj7xOwgA5Pavoy6tbe9tZLa7gint5V2yRSoGRx6EHginQwxW8EcMEaRRRqFREUKqqOAAB0FXf3+b+v6RNvd5f6/pj6KKKQwooooAKKKKACiiigAooooAKKKKACiiigAooooA/9k=" /></results>

�惧舰楠�璇���宸茬�����锛���浠跺��涓�:659765260.jpg璇疯������杈��ュ�惧舰楠�璇��

n3dp ----这个n3dp,需要进/usr/local/fetion,查看以飞信号命名的jpg图片,是我要输入的验证码

clip_image022

�ㄨ��ョ��璇�������:n3dp

SIP-C/4.0 280 Send SMS OK

T: sip:[email protected];p=1122

I: 3

Q: 1 M

L: 114

D: Thu, 28 Jun 2012 09:18:27 GMT

XI: 9DCC88427FFB8B60AC45E5D2DD00F2A9

[root@cnyunwei fetion]# /usr/local/fetion/fetion --sid=6597***** --pwd=***** --to=1352***** --msg-type=1 --msg-utf8="cnyunweiw.com报警测试-111111111111111"

SIP-C/4.0 280 Send SMS OK

T: sip:[email protected];p=1122

I: 3

Q: 1 M

L: 114

D: Thu, 28 Jun 2012 09:18:44 GMT

XI: FEA19BEA03682DA412CA37A955359B15

[root@cnyunwei fetion]#

看看你的手机收到测试短信没有,内容为cnyunweiw.com报警测试-111111111111111

你可能感兴趣的:(target,title,短信,blank,Email地址)