【centreon监控】启用短信和邮件报警
根据前人文档,可以在“监控”--“事件日志”里查看是否产生了报警五、短信警报配置
1.安装fetion机器人
fetion网址:http://bbs.it-adv.net/viewthread.php?tid=1081
下载二进制程序:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg
下载支持库文件:
http://www.it-adv.net/fetion/linuxso_20101113.rar
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg
安装:
linuxso_20101113.rar文件在Windows 下解压,上传到linux,
# mv linuxso_20101113 /usr/local/fetion
fetiony 主程序也copy到/usr/local/fetion下
# cp fetion /usr/local/fetion/
# chmod 755 /usr/local/fetion/fetion
# chown –R nagios.nagios /usr/local/fetion
2.测试
# LD_LIBRARY_PATH=/usr/local/fetion /usr/local/fetion/fetion --mobile=136XXXXXXX --pwd=your_password --to=136XXXXXXX --msg-utf8="test for fetion"
第一次使用,它会要求输入验证码,
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image003.jpg
把验证码的136****.jpg 文件,下载到windows后查看,然后在linux上输入即可,这后会有缓存,以后就不用再输入了。
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image005.jpg
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image007.jpg
3. 与centreon 结合
3.1 定义主机警报命令:
注意把手机号替换成你的号:
Command_namenotify-host-by-fetion
Command_line LD_LIBRARY_PATH=/usr/local/fetion /usr/local/fetion/fetion --mobile=136******** --pwd=*********** --to=$CONTACTPAGER$ --msg-utf8="Host $HOSTSTATE$ alert for $HOSTNAME$($HOSTADDRESS$)! on $LONGDATETIME$" $CONTACTPAGER$
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image008.jpgfile:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image009.jpg
3.2 定义服务警报命令:
Command_namenotify-host-by-fetion
Command_line LD_LIBRARY_PATH=/usr/local/fetion /usr/local/fetion/fetion --mobile=136******** --pwd=*********** --to=$CONTACTPAGER$--msg-utf8="$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ on $LONGDATETIME$"
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image010.jpgfile:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image011.jpg
3.3 配置联系人电话和一些警报选项:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image012.jpgfile:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image013.jpgfile:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image015.jpg
4. 主机启动警报:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image016.jpgfile:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image017.jpg
激活配置后,没有打叉的图标,就是启用警报了:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image018.jpg
关闭被监控机后,可以查看centreon的事件日志,已经调用了警告命令:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image020.jpg
5. 服务启用警报:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image021.jpg
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image022.jpg
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image024.jpg
停掉HTTP服务后查看日志,短信命令已经调用了:
file:///C:/Users/LIUCHA~1/AppData/Local/Temp/msohtmlclip1/01/clip_image025.jpg
6、邮件警报配置
默认已经可以用了,填上邮箱就可以。
页:
[1]