今天 帮群里一兄弟配了下nagios上的飞信,这个东西 我个人感觉还是很实用的,不过好久没配了,今天配置了一遍,顺便 就把过程记录下来了,供大家学习!!!
一、安装飞信

cd/root/toolswgethttp://ebook.elain.org/tools/fetion20101205.tar.gz安装步骤略,软件包中有添加要接收报警短信的手机号为飞信好友

/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8="TheFetiontestisok"
注:第一次要输入验证码,生成验证码后,另开一终端把图片下载下来,打开查看,注意区分大小写!!!二、vi commands.cfg 添加

definecommand{command_namenotify-host-by-fetioncommand_line/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8="**$NOTIFICATIONTYPE$HostAlert:$HOSTNAME$is$HOSTSTATE$**"}definecommand{command_namenotify-service-by-fetioncommand_line/usr/local/fetion/fetion--mobile=137xxxxxxxx--pwd=1111111--to=138xxxxxxxx--msg-type=1--msg-utf8="**$NOTIFICATIONTYPE$\n\nService:$SERVICEDESC$\nHost:$HOSTALIAS$\nAddress:$HOSTADDRESS$\nState:$SERVICESTATE$\n\nDate/Time:$LONGDATETIME$\n\nAdditionalInfo:\n\n$SERVICEOUTPUT$**"}三、vi templates.cfg

definecontact{…………service_notification_commandsnotify-service-by-fetionhost_notification_commandsnotify-host-by-fetion…………}

四、 vi contacts.cfg

definecontact{contact_nameelainaliassaservice_notification_period24x7host_notification_period24x7service_notification_optionsw,u,c,rhost_notification_optionsd,u,rservice_notification_commandsnotify-service-by-email,service-notify-by-fetionhost_notification_commandsnotify-host-by-email,host-notify-by-fetionemailelain2012@hotmail.compager138xxxxxxxx}

/etc/init.d/nagioscheckconfig#检查配置文件正确性/etc/nit.d/nagiosreload#重新加载配置文件

停服务做测试!!!

转载请注明: 转载自http://www.elain.org

本文链接地址:CentOS下nagios报警飞信部署四步走