nagios 飞信通知
测试发短信: ./sms -f 13611031*** -p**** -t 13611031*** -m test [Wed Jul 30 05:18:06 2008] :) Send msg to 13611031*** ok! 发送OK,好了我们来做一个脚本吧。 cd /usr/local/nagios/libexec vim sms sms -f 13611031*** -p ****** -t "$1" -m "$2" ($1为接收人手机号,$2为发送消息。脚本建立 完毕后,去command.cfg 添加如下: define command { command_name host-notify-by-sms command_line $USER1$/sms 13611031*** "Host $HOSTSTATE$ alert for $HOSTNAME$! on '$DATETIME$' " $CONTACTPAGER$ } #service notify by sms define command { command_name service-notify-by-sms command_line $USER1$/sms 13611031*** "'$HOSTADDRESS$' $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$ } 保存退出,修改templates.cfg service-notify-by-mail 和 host-notify-by-mail 为 service-notify-by-sms 和 host-notify-by-sms 保存推出,最后从启 nagios ,停止一个监控服务看看吧。 我还是把 rad hat 编译安装 libACE 库补上吧。 http://download.dre.vanderbilt.edu/ 下载 ACE.tar.gz 2 tar -xcvf ./ACE-5.4.tar.gz后生成一个目录ACE_wrappers, 假定我们的目录是/root/ace_study/ACE_wrappers 为保险起见执行chmod a=rwx -R ACE_wrappers 3 在etc/profile文件中这样写 # Path manipulation if [ `id -u` = 0 ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin #下面这行是要加的 pathmunge /root/ace_study/ACE_wrappers fi #下面这两行是要加上的 ACE_ROOT=/root/ace_study/ACE_wrappers; export ACE_ROOT 退出,注销CentOS 5; (编辑:应用网_丽江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |