网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

使用nagios监控io,内存

1.在监控机上安装NRPE
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
 
2.在被监控机上安装nagios插件和NRPE
(1).先增加nagios用户:
useradd nagios

建网站原本是网站策划师、网络程序员、网页设计师等,应用各种网络程序开发技术和网页设计技术配合操作的协同工作。创新互联建站专业提供成都网站设计、成都网站建设,网页设计,网站制作(企业站、成都响应式网站建设、电商门户网站)等服务,从网站深度策划、搜索引擎友好度优化到用户体验的提升,我们力求做到极致!

(2.)安装nagios插件:
tar -zxvf nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14
./configure --prefix=/usr/local/nagios
make
make install

(3).安装nrpe:
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --prefix=/usr/local/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd    nrpe安装为xinetd服务

(4).编辑nrpe配置文件,增加监控机地址:
#vi /etc/xinetd.d/nrpe
only_from  = 192.168.18.100

(5).修改services文件,增加端口
#vi /etc/services
nrpe            5666/tcp                        #NRPE

(6).重启xinetd服务
service xinetd restart

(7).查看服务是否启动
#/usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12
如果出现Connection refused by host 需要安装yum intall openssl*
至此被监控机上的操作就结束了,如果有需要增加监控项,需修改/etc/xinetd.d/nrpe文件。
 
3.修改监控机上commands.cfg文件,增加check_nrpe的定义:
define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

4.在监控机上测试与被监控机的通讯是否正常:
[root@test1 objects]# /usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
OK - load average: 0.05, 0.06, 0.00|load1=0.050;15.000;30.000;0; load5=0.060;10.000;25.000;0; load15=0.000;5.000;20.000;0;
能够正常获取信息。


vim /usr/local/nagios/etc/nrpe.cfg

修改 allowed_hosts=192.168.18.100(监控机)

增加
command[check_sda2]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda2  --意思是监控第二个分区

command[check_swap]=/usr/local/nagios/libexec/check_swap -w 20% -c 10%   -监控内存


修改监控机的services.cfg

增加需要监控的服务
5.修改服务配置文件:
增加:
define service {
host_name  wangbo

max_check_attempts          5
check_period            24x7
notification_interval       10
normal_check_interval       1
retry_check_interval        1
service_description checkdisk2
check_command check_nrpe!check_sda2             ###########监控第二个硬盘
notification_period    24x7
notification_options    w,u,c,r
contact_groups        tomasgroup
                       }


define service {
host_name  wagbo

max_check_attempts          5
check_period            24x7
notification_interval       10
normal_check_interval       1
retry_check_interval        1
service_description checkLoad
check_command check_nrpe!check_load            ###########     监控CPU负载
notification_period    24x7
notification_options    w,u,c,r
contact_groups         tomasgroup
                       }


define service {
host_name wangbo

max_check_attempts          5
check_period            24x7
notification_interval       10
normal_check_interval       1
retry_check_interval        1
service_description checkswap
check_command check_nrpe!check_swap                   监控内存
notification_period    24x7
notification_options    w,u,c,r
contact_groups         tomasgroup      }
 


文章名称:使用nagios监控io,内存
当前网址:http://bjjierui.cn/article/pjihsh.html

其他资讯