新版飞信+Nagios部署监控系统_新版Linux下安装飞信1、飞信官方命令下载:fetionlinux: http://www.it-adv.net/fetion/downng/fetion20090406003-linux.tar.gz(下载地址)
新版飞信+Nagios部署监控系统_新版tar –xvf     fetion20090406003-linux.tar.gz
新版飞信+Nagios部署监控系统_新版cd install    
新版飞信+Nagios部署监控系统_新版cp fetion / usr/bin (拷贝命令到/usr/bin/下)
新版飞信+Nagios部署监控系统_新版useradd nagios
新版飞信+Nagios部署监控系统_新版chmod -R 7755 /usr/bin/fetion    
新版飞信+Nagios部署监控系统_新版chown -R    nagios:nagios /usr/bin/fetion
新版飞信+Nagios部署监控系统_新版3、更新日志:http://bbs.it-adv.net/viewthread.php?tid=1574、飞信命令行工具/飞信机器人(2009版) ,文件列表说明(fetion20090406003-linux.tar.gz中包含文件说明)
新版飞信+Nagios部署监控系统_新版 fetion    linux下主运行程序
新版飞信+Nagios部署监控系统_新版 fetion.exe  win32下主运行程序
新版飞信+Nagios部署监控系统_新版 sample.conf  演示配置文件
新版飞信+Nagios部署监控系统_新版 readme.txt    本说明文件
新版飞信+Nagios部署监控系统_新版 plugins 机器人框架程序
新版飞信+Nagios部署监控系统_新版 fxdemo.sql 机器人框架数据库(请导入到数据库)
新版飞信+Nagios部署监控系统_新版    cron.sh             机器人监控程序(LINUX)
新版飞信+Nagios部署监控系统_新版    robots.dat        机器人账号密码(配合cron.sh)
新版飞信+Nagios部署监控系统_新版注:本程序需要 libACE的支持,库请到 http://www.it-adv.net/    中下载5、Linux 下需用用到的4个文件
新版飞信+Nagios部署监控系统_新版 http://www.it-adv.net/fetion/downng/library_linux.tar.gz(下载地址)
新版飞信+Nagios部署监控系统_新版         libACE.so.5.6.8
新版飞信+Nagios部署监控系统_新版         libACE_SSL.so.5.6.8
新版飞信+Nagios部署监控系统_新版         libcrypto.so.0.9.8
新版飞信+Nagios部署监控系统_新版         libssl.so.0.9.8
新版飞信+Nagios部署监控系统_新版 6、tar –xvf library_linux.tar.gz(在安装飞信之前需要在/usr/lib目录下加上libACE库文件,以便使飞信能够正常使用)复制这几个文件到这两个目录下 /lib/ /usr/lib/
新版飞信+Nagios部署监控系统_新版ldd /usr/bin/fetion>> 使用说明 <<
新版飞信+Nagios部署监控系统_新版以下参数提供登录用的账号密码(三种方式,手机号-密码 飞信号-密码文件--索引)
新版飞信+Nagios部署监控系统_新版        --mobile=[手机号]             登录手机号
新版飞信+Nagios部署监控系统_新版        --sid=[飞信号]                登录飞信号
新版飞信+Nagios部署监控系统_新版        --pwd=[密码]                 登录密码
新版飞信+Nagios部署监控系统_新版        --config=[文件名]             存储手机号、密码的文件。
新版飞信+Nagios部署监控系统_新版        --index=[索引号]             索引
新版飞信+Nagios部署监控系统_新版        以下参数提供接收者
新版飞信+Nagios部署监控系统_新版        --to=[手机号/飞信号/URI]     接收消息的手机号/飞信号/URI.如果知道对方URI,则只需自己在对方好友列表,无需对方在自己好友列表就能发送。
新版飞信+Nagios部署监控系统_新版                     20090203003版本后,支持多个号码,中间用,逗号分隔
新版飞信+Nagios部署监控系统_新版        --msg-utf8=[信息]    
新版飞信+Nagios部署监控系统_新版         发送的消息,UTF8编码
新版飞信+Nagios部署监控系统_新版        --msg-gb=[信息]    
新版飞信+Nagios部署监控系统_新版            发送的消息,GB编码
新版飞信+Nagios部署监控系统_新版        --file-utf8=[文件utf8格式]
新版飞信+Nagios部署监控系统_新版            发送文件内容
新版飞信+Nagios部署监控系统_新版        --file-gb=[文件gb格式]
新版飞信+Nagios部署监控系统_新版            发送文件内容
新版飞信+Nagios部署监控系统_新版        --msg-type=[0/1/2]    
新版飞信+Nagios部署监控系统_新版            发送消息类型:普通消息 长消息 智能短信
新版飞信+Nagios部署监控系统_新版         小工具        
新版飞信+Nagios部署监控系统_新版         --query-cmcc-no    查询移动公司手机段
新版飞信+Nagios部署监控系统_新版         以下为可选项
新版飞信+Nagios部署监控系统_新版        --debug    
新版飞信+Nagios部署监控系统_新版        显示调试信息
新版飞信+Nagios部署监控系统_新版        --hide            
新版飞信+Nagios部署监控系统_新版        隐身登录
新版飞信+Nagios部署监控系统_新版        --proxy-ip=http代理ip
新版飞信+Nagios部署监控系统_新版        --proxy-port=http代理端口
新版飞信+Nagios部署监控系统_新版>> 举例 <<
新版飞信+Nagios部署监控系统_新版 linux下,请使用如下命令:cd install 进去解压后目录./fetion --mobile=13466xxxx --pwd=chengxc123 --to 13466xxx --msg-utf8=123 (测试飞信能否成功发送短信,发送对象需是自己飞信好友或自己) 一、        yum安装ngiosyum groupinstall "Nagios Monitoring System"    
新版飞信+Nagios部署监控系统_新版yum -y install nagios-plugins-all    
新版飞信+Nagios部署监控系统_新版cd /etc/nagios/
新版飞信+Nagios部署监控系统_新版nagios -v nagios.cfg 检测nagios    配置文件是否合法
新版飞信+Nagios部署监控系统_新版htpasswd -cb /etc/nagios/passwd admin 123    (用户名 admin密码123) 生成nagios登录密码
新版飞信+Nagios部署监控系统_新版不要忘了修改cgi.cfg文件以下行
新版飞信+Nagios部署监控系统_新版authorized_for_system_information=admin
新版飞信+Nagios部署监控系统_新版authorized_for_configuration_information=admin
新版飞信+Nagios部署监控系统_新版authorized_for_system_commands=admin
新版飞信+Nagios部署监控系统_新版authorized_for_all_services=admin
新版飞信+Nagios部署监控系统_新版authorized_for_all_hosts=admin
新版飞信+Nagios部署监控系统_新版authorized_for_all_service_commands=admin
新版飞信+Nagios部署监控系统_新版authorized_for_all_host_commands=admin
新版飞信+Nagios部署监控系统_新版为了支持Nagios安装完后status map,trend等完全显示,需要gd库的支持,首先看一下gd与gd-devel有没有安装
新版飞信+Nagios部署监控系统_新版rpm -qa |grep gd
新版飞信+Nagios部署监控系统_新版用yum -y install gd*安装也可 二、修改主要配置文件
新版飞信+Nagios部署监控系统_新版1、vim /etc/httpd/conf.d/nagios.conf
新版飞信+Nagios部署监控系统_新版ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi-bin/<Directory /usr/lib/nagios/cgi-bin/>
新版飞信+Nagios部署监控系统_新版     deny from none
新版飞信+Nagios部署监控系统_新版     allow from all    (可以是独立的ip或网段)
新版飞信+Nagios部署监控系统_新版Alias /nagios/ /usr/share/nagios/html/
新版飞信+Nagios部署监控系统_新版<Directory /usr/share/nagios/html/>
新版飞信+Nagios部署监控系统_新版     Options None
新版飞信+Nagios部署监控系统_新版     order deny,allow
新版飞信+Nagios部署监控系统_新版     deny from none
新版飞信+Nagios部署监控系统_新版     allow from all
新版飞信+Nagios部署监控系统_新版2、编译安装配置httpd.conf文件路径:vim /usr/local/apache2/conf/httpd.conf在最下面:        Include /etc/httpd/conf.d/nagios.conf/usr/local/apache2/bin/httpd -k start    
新版飞信+Nagios部署监控系统_新版vim /etc/nagios/nagios.cfg
新版飞信+Nagios部署监控系统_新版添加下列行
新版飞信+Nagios部署监控系统_新版cfg_file=/etc/nagios/cheng.cfg(自定义的,添加即可)
新版飞信+Nagios部署监控系统_新版cfg_file=/etc/nagios/contactgroups.cfg(默认就有去掉注释)
新版飞信+Nagios部署监控系统_新版cfg_file=/etc/nagios/contacts.cfg(默认)
新版飞信+Nagios部署监控系统_新版cfg_file=/etc/nagios/miscommands.cfg(自己定义的)
新版飞信+Nagios部署监控系统_新版即创建自定义文件cheng.cfg、contactgroups.cfg、contacts.cfg、miscommands.cfg
新版飞信+Nagios部署监控系统_新版配置cheng.cfg
新版飞信+Nagios部署监控系统_新版define host{                use                                         linux-server                host_name                             vfast                contact_groups                    vfastgroup                max_check_attempts                5                alias                                     localhost                address                                 192.168.0.105                }define service{                use                                                         local-service                host_name                                            admin
新版飞信+Nagios部署监控系统_新版                contact_groups                                    admingroup                service_description                         PING                check_command                                     check_ping!100.0,20%!500.0,60%                }
新版飞信+Nagios部署监控系统_新版define service{                use                                                         local-service                host_name                                             chao                contact_groups                                    admingroup                service_description                         HTTP_CHECK                check_command                                     check_http             }define host{                use                                         linux-server                host_name                             chao                contact_groups                    admingroup                max_check_attempts            5                alias                                     localhost                address                                 192.168.0.110                } define hostgroup{                hostgroup_name    chaoguo
新版飞信+Nagios部署监控系统_新版                alias                     Test Servers                members                 admin,chao                }    
新版飞信+Nagios部署监控系统_新版define service {                host_name                         chao                service_description     check-host-alive                check_period                    24x7                max_check_attempts        4                normal_check_interval 3                retry_check_interval    2                contact_groups                admingroup                notification_interval     10                notification_period         24x7                notification_options        w,u,c,r                check_command                     check-host-alive                }配置contactgroups.cfg
新版飞信+Nagios部署监控系统_新版define contactgroup {            contactgroup_name        admingroup            alias                                system administrator group            members                            admin
新版飞信+Nagios部署监控系统_新版            }配置contacts.cfg
新版飞信+Nagios部署监控系统_新版define contact {             contact_name                                        admin
新版飞信+Nagios部署监控系统_新版             alias                                                     system admin             host_notification_period                24x7             service_notification_period         24x7             host_notification_options             d,r             service_notification_options        c,w,r             service_notification_commands     notify-service-by-fetion#            service_notification_commands     notify-service-by-email             host_notification_commands            notify-host-by-fetion#            email                                                    1234@sina.com             pager                                                 1312323232323 #手机号    }配置miscommands.cfg文件
新版飞信+Nagios部署监控系统_新版define command {                 command_name                        notify-host-by-fetion                 command_line             /usr/bin/fetion --mobile=13422222222 --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="Host $HOSTSTATE$ alert for $HOSTNAME$! on '$LONGDATETIME$'" $CONTACTPAGER$} define command {                 command_name                 notify-service-by-fetioncommand_line        /usr/bin/fetion --mobile=134663xxxx --pwd=xxxxxxxx --to=$CONTACTPAGER$ --msg-utf8="$HOSTADDRESS$ $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ on $LONGDATETIME$" $CONTACTPAGER$                            }三、客户端的配置:1、需求软件的下载:nagios插件程序:http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gznrpe软件:http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz2、软件的安装(1) nagios插件的安装:         首先在安装前建立nagios用户,命令如下:useradd nagios -s /sbin/nologin –Mtar zxvf nagios-plugins-1.4.13.tar.gzcd nagios-plugins-1.4.13./configure --prefix=/usr/local/nagiosmake && make installchown -R nagios.nagios /usr/local/nagios/(2) nrpe的程序的安装:tar zxvf nrpe-2.12.tar.gzcd nrpe-2.12./configureMake all Make install-pluginMake install-daemonMake install-daemon-config (3) 修改nrpe.cfg配置文件:vi /usr/local/nagios/etc/nrpe.cfg将server_address修改为本机ip地址将allowed_hosts地址改为远程控制器ip地址 (4) 运行nrpe服务:/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d (5) 查看nrpe运行情况:Netstat –pant | grep nrpe看nrpe是否运行成功,占用端口5666 (6) 设置nrpe自启动:Vi /etc/rc.local/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d至此客户端配置玩活.