1、安装解压rar格式的解压软件
- [root@web1 tmp]# wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
- [root@web1 tmp]# tar zxvf rarlinux-3.8.0.tar.gz
- [root@web1 tmp]# cd rar
- [root@web1 rar]# make install
- [root@web1 rar]# cd ..
- [root@web1 tmp]# wget http://www.it-adv.net/fetion/linuxso_20101113.rar
- [root@web1 tmp]# unrar x linuxso_20101113.rar
- [root@web1 tmp]# cp lib*so* /usr/lib
- [root@web1 ~]# echo "/usr/lib" >> /etc/ld.so.conf
- [root@web1 tmp]# ldconfig
- [root@web1 tmp]# cp fetion /usr/local/ 把飞信复制到/usr/local/里
- [root@web1 local]# chmod 777 fetion
- [root@web1 local]# chown nagios:nagios fetion
- [root@web1 local]# ./fetion --mobile=152******** --pwd=*** --to=152********--msg-utf8=test
- # 'notify-host-by-fei' command definition
- define command {
- command_name notify-host-by-fei
- command_line /usr/local/fetion --mobile=15201352163 --pwd=xyy528888 --to=$CONTACTPAGER$ --msg-utf8="Host $HOSTSTATE$ alert for $HOSTNAME$! on '$LONGDATETIME$'" $CONTACTPAGER$
- }
- # 'notify-service-by-fei' command definition
- define command {
- command_name notify-service-by-fei
- command_line /usr/local/fetion --mobile=15201352163 --pwd=xyy528888 --to=$CONTACTPAGER$ --msg-utf8="$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ on $LONGDATETIME$" $CONTACTPAGER$
- }
- service_notification_commands notify-service-by-email,notify-service-by-fei
- host_notification_commands notify-host-by-email,notify-host-by-fei
- [root@web1 etc]# tail -f /usr/local/nagios/var/nagios.log
- [1320401780] SERVICE NOTIFICATION: nagiosadmin;web1;HTTP;WARNING;notify-service-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.018 second response time
- [1320401868] Caught SIGTERM, shutting down...
- [1320401868] Successfully shutdown... (PID=5878)
- [1320401869] Nagios 3.3.1 starting... (PID=6118)
- [1320401869] Local time is Fri Nov 04 06:17:49 EDT 2011
- [1320401869] LOG VERSION: 2.0
- [1320401869] Finished daemonizing... (New PID=6119)
- [1320402489] SERVICE NOTIFICATION: test;web1;HTTP;WARNING;notify-service-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.003 second response time
- [1320402502] SERVICE NOTIFICATION: nagiosadmin;web1;HTTP;WARNING;notify-service-by-fei;HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.003 second response time
- [1320402503] SERVICE NOTIFICATION: nagiosadmin;web1;HTTP;WARNING;notify-service-by-email;HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.003 second response time
本文出自 “吟—技术交流” 博客,请务必保留此出处http://dl528888.blog.51cto.com/2382721/770684