nagios监控网络服务器和网络服务故障处理篇
发布时间:2022-04-26 10:38:28 所属栏目:安全 来源:互联网
导读:nagios添加主机和服务可能出现的问题有如下情况: 1:配置参数出现问题,如果你没有检查配置就启动nagios,可能会启动成功,但是显示会不正常; 解决方法:调整配置参数 2:Connection refused 当出现这个问题的时候,我开始以为是ssh的无密码登录没有成功,
nagios添加主机和服务可能出现的问题有如下情况: 1:配置参数出现问题,如果你没有检查配置就启动nagios,可能会启动成功,但是显示会不正常; 解决方法:调整配置参数 2:Connection refused 当出现这个问题的时候,我开始以为是ssh的无密码登录没有成功,但是其实我的服务器没有启动该服务造成的,启动服务即可。但是这些是有端口的服务,没有使用端口的状态任何检测?使用nrpe,ok,我们现在在服务器上安装nrpe: 一、远程主机的配置 1、安装nrpe与配置 复制 fetch http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz tar zxvf nrpe-2.5.2.tar.gz cd nrpe-2.5.2 ./configure --enable-ssl --enable-command-args make all mkdir -p /usr/local/nagios/etc mkdir /usr/local/nagios/bin mkdir /usr/local/nagios/libexec pw addgroup nagios pw useradd nagios -g nagios -d /usr/local/nagios/ -s /sbin/nologin chown -R nagios:nagios /usr/local/nagios cp ./sample-config/nrpe.cfg /usr/local/nagios/etc cp src/nrpe /usr/local/nagios/bin 二、监控服务器上的配置 1、安装nrpe(主要是使用check_nrpe模块) 复制 fetch http://ufpr.dl.sourceforge.net/sourceforge/nagios/nrpe-2.5.2.tar.gz tar zxvf nrpe-2.5.2.tar.gz cd nrpe-2.5.2 ./configure --enable-ssl --enable-command-args make all cp src/check_nrpe /usr/local/nagios/libexec 三、上面我们已经配置了一部分参数 下面是配置的最终结果: 复制 define host{ use generic-host ; Name of host template to use host_name test_nrpe alias client address 10.5.1.156 check_command check-host-alive max_check_attempts 1 check_period 24x7 notification_interval 120 notification_period 24x7 notification_options d,r contact_groups admins } # 'check_load' command definition define command{ command_name check_load command_line $USER1$/check_load -w $ARG1$ -c $ARG2$ } # 'check_load' command definition define command{ command_name check_disk command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ } define service{ use generic-service ; Name of service template to use host_name test_nrpe service_description PING is_volatile 0 check_period 24x7 max_check_attempts 1 normal_check_interval 1 retry_check_interval 1 contact_groups admins notification_options w,u,c,r notification_interval 960 notification_period 24x7 check_command check_ping!100.0,20%!500.0,60% (编辑:应用网_丽江站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |