版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年企业文化企业文化维护考试试题及答案
- 项目验收表格设计精讲
- 2026鲁丽集团招聘面试题及答案
- 2026辽宁文体旅产业发展集团秋招面笔试题及答案
- 2026辽宁能源产业控股集团校招试题及答案
- 大班下学期科学学科《旋转运动》探究式教学设计
- 高中历史教学中数字素养的融入与历史事件分析能力提升教学研究课题报告
- 2026年电子电气技术的标准化与规范化
- 2026年基于G的建筑设备自动化解决方案
- 2026年清洁能源水电的环境影响及对策
- 江苏百校大联考2026届高三语文第一学期期末学业质量监测试题含解析
- 代还按揭协议书
- 广西2025年高等职业教育考试全区模拟测试 能源动力与材料 大类试题及逐题答案解说
- 2026江苏省公务员考试公安机关公务员(人民警察)历年真题汇编附答案解析
- 2026年失眠患者睡眠调理指南
- 2026年盘锦职业技术学院单招职业适应性测试题库及答案详解一套
- 2025年10月自考00610高级日语(二)试题及答案
- 2026年包头铁道职业技术学院单招职业技能考试题库带答案解析
- 循证护理在基础护理中的应用
- 复旦大学招生面试常见问题及回答要点
- 危险化学品兼容性矩阵表
评论
0/150
提交评论