版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、nagios nrpe监控远程主机 nagios nrpe监控远程主机详细步骤如下。 1. 监控机的软件的安装 监控机安装nrpe wget /sourceforge/nagios/nrpe-2.12.tar.gz tar zxvf nrpe-2.12.tar.gz cd nrpe-2.12 ./configure -prefix=/usr/local/nagios make all make install-plugin #监控机只需安装到这步 2. 被监控机的软件的安装 被监控机添加用户 groupadd nagios useradd -g nagios -d /usr/local/nag
2、ios -s /sbin/nologin nagios 被监控机安装plugin wget /sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz tar zxf nagios-plugins-1.4.13.tar.gz cd nagios-plugins-1.4.13 ./configure -with-nagios-user=nagios -with-nagios-group=nagios -prefix=/usr/local/nagios -with-ping-command=/bin/ping -with-mysql=/opt/mysq
3、l make make install #查看播件文件是否已安装在这个名目 ls /usr/local/nagios/libexec 被监控机安装nrpe wget /sourceforge/nagios/nrpe-2.12.tar.gz 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 cp init-script /etc/init.d/
4、nagios-nrpe chown -r nagios:nagios /usr/local/nagios 3. 被监控机的配置 配置 nrpe: vi /usr/local/nagios/etc/nrpe.cfg allowed_hosts=,1 #nagios监控机的地址或域名 修改/etc/hosts.allow增加监控机ip echo 'nrpe:1' /etc/hosts.allow 启动 nrpe 守护进程: /usr/local/nagios/bin/nrpe -c /usr/local/nagios/e
5、tc/nrpe.cfg -d 可以将此命令加入 /etc/rc.local ,以便开机自动启动。 echo /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d /etc/rc.local 检查 nrpe 是否正常: /usr/local/nagios/libexec/check_nrpe -h 查看相应的端口:netstat -an |grep 5666 防火墙开启5666 允许局域网ip或固定ip连接 在监控主机上 /usr/local/nagios/libexec/check_nrpe -h $
6、目标主机地址 都应当可以输出 nrpe 的版本: nrpe v2.12 检查可监控的服务 在被监控端的 nrpe.cfg 文件中,可以看到这样的配置: commandcheck_load=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 这是用来检查 cpu 负载的。 假如需要自定参数则使用下面命令 commandcheck_load=/usr/local/nagios/libexec/check_load -w $arg1$ -c $arg2$ 并开启dont_blame_nrpe =1 开启参数将会带来肯定的平安风险 被
7、监控机重启nrpe ps aux|grep nrpe kill $pid /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg d 4. 监控机设置 在监控机commands.cfg 添加nrpe的定义 # 'check_nrpe ' command definition define command command_name check_nrpe command_line $user1$/check_nrpe -h $hostaddress$ -c $arg1$ 增加hosta.cfg 在/usr/local
8、/nagios/etc/objects/ 名目下新建文件:hosta.cfg 把a.cfg添加到nagios主机: echo cfg_file=/usr/local/nagios/etc/objects/hosta.cfg /usr/local/nagios/etc/nagios.cfg 假如要再添加b机器方法炮制就可以了 hosta.cfg define host use generic-server host_name a alias a address a 的ip define service use generic-service host_name a service_descrip
9、tion load check_command check_nrpe!check_load #使用自定参数 #check_command check_nrpe!check_load!6.0,5.0,4.0!15.0,8.0,6.0 重启监控机nagios service nagios reload 访问http:/localhost/nagios就可以看到新增的机器了 如何修改nrpe端口 被监控机nrpe.cfg修改server_port为15666 server_port=15666 重启nrpe 监控机commands.cfg增加-p 15666 define command comma
10、nd_name check_nrpe command_line $user1$/check_nrpe -h $hostaddress$ -p 15666 -c $arg1$ 重启nagios就可以了 connection refused or timed out 检查nrpe 端口 检查nrpe.cfg中allowed_hosts是否包含监控机ip地址 检查/etc/hosts.allow文件中监控机ip地址nrpe:1 检查iptables 开放5666端口 iptables -l iptables -a rh-firewall-1-input -p tcp -m st
11、ate -state new -m tcp -dport 5666 -j accept #留意挨次 iptables -l service iptables save service iptables restart 通过文章,我们不难发觉nagios nrpe监控远程主机操作特别简洁! question 1: when i execute check_nrpe command with some arguments, i get the message “check_nrpe: received 0 bytes from daemon. check the remote server logs for error messages.”. how do i fix this issue? answer 1: the issue is very straight forward. check_nrpe doesnt take any arguments b
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年苏州信息职业技术学院单招职业适应性测试题库及答案
- 2026年青海省高职单招职业技能考试题库及答案
- 2026年湖南工业职业技术学院单招面试题库及答案
- 防火墙规则清洗课程设计
- 爬虫Scrapy框架学习课程设计
- 车站售票系统Java课程设计
- 数字示波器设计(FPGA实现)设计课程设计
- cdio课程设计张育
- 贝叶斯网络诊断系统维护课程设计
- 筹资课程设计
- 2023-2024学年四川省成都市成华区八年级(下)期末数学试卷
- 战伤换药技术课件
- 新浙教版数学八年级上册讲义(共15讲)
- DBJT13-144-2019 福建省建设工程监理文件管理规程
- 17、监控改造工程重点及难点分析
- 砖砌体工程劳务分包合同模板
- 《数学课程标准》义务教育2022年修订版(原版)
- 2024年汕头市龙湖区教育局招考聘用机关聘用人员高频500题难、易错点模拟试题附带答案详解
- 中医外科学笔记
- SY-T 5037-2023 普通流体输送管道用埋弧焊钢管
- Smart-manager-中文说明书改
评论
0/150
提交评论