1. 安装
    rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
    rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd bc
    安装nagios插件
    yum -y install nagios-plugins-all nagios-plugins-nrpe
    nagios-plugins目录:/usr/lib64/nagios/plugins/
    安装nrpe
    yum -y install nrpe
  2. 修改nrpe设置
    vi /etc/nagios/nrpe.cfg
    only_from = 127.0.0.1,Server_IP
  3. 修改防火墙设置
    添加5666端口,重启iptables
  4. 修改services服务
    vi /etc/services
    添加
    nrpe            5666/tcp                # NRPE
    service xinetd restart
  5. 测试nrpe是否安装成功
    cd /usr/lib64/nagios/plugins/
    ./check_nrpe -H 127.0.0.1
    若提示失败,可能是nrpe未安装或nrpe.cfg配置文件设置错误导致
  6. 修改nrpe.cfg
    vi /etc/nagios/nrpe.cfg
    注释掉目录不存在的nagios插件命令
    #command[check_users]=/usr/local/nagios/libexec/check_users -w  -c
    #command[check_load]=/usr/local/nagios/libexec/check_load -w ,, -c ,,
    #command[check_hda1]=/usr/local/nagios/libexec/check_disk -w % -c % -p /dev/hda1
    #command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w -c -s Z
    #command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w -c command[check_users]=/usr/lib64/nagios/plugins/check_users -w -c
    command[check_load]=/usr/lib64/nagios/plugins/check_load -w ,, -c ,,
    command[check_sda1]=/usr/lib64/nagios/plugins/check_disk -w % -c % -p /dev/sda1
    command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w -c -s Z
    command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w -c

    Code

    测试命令是否能够执行
    cd /usr/lib64/nagios/plugins/
    ./check_nrpe -H 127.0.0.1 -c check_users
    ./check_nrpe -H 127.0.0.1 -c check_load
    ./check_nrpe -H 127.0.0.1 -c check_sda1
    ./check_nrpe -H 127.0.0.1 -c check_zombie_procs
    ./check_nrpe -H 127.0.0.1 -c check_total_procs

  7. 配置Nagios监控端服务器
    cd /usr/lib64/nagios/plugins/
    ./check_nrpe -H Remote_linux_ip_address(被监控的ServerIP)
    显示 NRPE v2.15 即正常
    cd /etc/nagios/objects
    touch hosts.cfg touch services.cfg
    vi hosts.cfg 注意修改IP
    ## Default Linux Host Template ##
    define host{
    name linux-box ; Name of this template
    use generic-host ; Inherit default values
    check_period 24x7
    check_interval
    retry_interval
    max_check_attempts
    check_command check-host-alive
    notification_period 24x7
    notification_interval
    notification_options d,r
    contact_groups admins
    register ; DONT REGISTER THIS - ITS A TEMPLATE
    } ## Default
    define host{
    use linux-box ; Inherit default values from a template
    host_name Nagios_Centos_Client1 ; The name we're giving to this server
    alias CentOS ; A longer name for the server
    address remote_linux_ip_address ; IP address of Remote Linux host
    }

    hosts.cfg Code

    vi services.cfg

    define service{
    use generic-service
    host_name Nagios_Centos_Client1
    service_description CPU Load
    check_command check_nrpe!check_load
    } define service{
    use generic-service
    host_name Nagios_Centos_Client1
    service_description Total Processes
    check_command check_nrpe!check_total_procs
    } define service{
    use generic-service
    host_name Nagios_Centos_Client1
    service_description Current Users
    check_command check_nrpe!check_users
    } define service{
    use generic-service
    host_name Nagios_Centos_Client1
    service_description Disk Monitoring
    check_command check_nrpe!check_sda1
    } define service{
    use generic-service
    host_name Nagios_Centos_Client1
    service_description Zombie Monitoring
    check_command check_nrpe!check_zombie_procs
    }

    services.cfg Code

    修改nagios.cfg
    vi /etc/nagios/nagios.cfg 添加如下两行配置
    cfg_file=/etc/nagios/objects/services.cfg
    cfg_file=/etc/nagios/objects/hosts.cfg
    修改command.cfg
    vi /etc/nagios/objects/commamds.cfg 添加

    define command{
    command_name check_nrpe
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
    }

    commamds.cfg Code

    检验nagios的配置是否正常
    cd /etc/nagios
    nagios -v nagios.cfg
    提示没有错误,重启nagios即可

  8. 参考文档:http://www.tecmint.com/how-to-add-linux-host-to-nagios-monitoring-server/
  9. 官方nrpe下载地址
    打开:http://sourceforge.net/projects/nagios/files/nrpe-2.x/
    wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

Configure new Nagios clients的更多相关文章

  1. Nagios在Ubuntu server上的安装配置

    首先我参看的是Nagios的官方文档,Nagios – Installing Nagios Core From Source——The Industry Standard in IT Infrastr ...

  2. CentOS6.6+Puppet3.7.4分布式部署Nagios监控系统

    测试框架 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CentOS-6.6-x86_64(minimal)   puppet-3.7 ...

  3. Nagios安装

    在做安装之前确认要对该机器拥有root权限. 确认你安装好的Fedora系统上已经安装如下软件包再继续: Apache GCC编译器 GD库与开发库 可以用yum命令来安装这些软件包: yum ins ...

  4. nagios监控系统安装及配置

    Nagios通常由一个主程序(Nagios).一个插件程序(Nagios-plugins)和四个可选的ADDON(NRPE.NSCA.NSClient++和NDOUtils)组成.Ngios的监控工作 ...

  5. Nagios学习笔记四:基于NRPE监控远程Linux主机

    1.NRPE简介 Nagios监控远程主机的方法有多种,其方式包括SNMP.NRPE.SSH和NCSA等.这里介绍其通过NRPE监控远程Linux主机的方式. NRPE(Nagios Remote P ...

  6. Nagios学习笔记一:基本安装和配置

    ()解决安装Nagios的依赖关系: Nagios基本组件的运行依赖于httpd.gcc和gd.可以通过以下命令来检查nagios所依赖的rpm包是否已经完全安装: # yum -y install ...

  7. 一步步实现Nagios监控linux主机及飞信报警

    一步步实现Nagios监控linux主机及飞信报警 上篇文章介绍了在linux主机上架设nagios监控服务,并对windows主机进行服务状态变化的监控,这次我们继续上次内容.      首先实现n ...

  8. Nagios:企业级系统监控方案

    在大多数情况下Cacti + RRDtool已经实现对系统各种参数的监测.但很多企业可能不满足于仅仅监测系统基本参数的需求,而是需要监测除基本参数之外的各种应用程序的运行状况.很显然在这种情况下对于一 ...

  9. 六大Nagios常见问题解决办法

    Nagios常见问题1: It appears as though you do not have permission to view information for any of the host ...

随机推荐

  1. C. Painting the Fence

    链接 [https://codeforces.com/contest/1132/problem/C] 题意 就是有个n长的栅栏,然后每个油漆工可以染的区域不同 给你q让你选出q-2个人使得被染色的栅栏 ...

  2. iOS 图像处理(一):获取某一点位置的像素

    2018.08.04 22:09 字数 671 阅读 203评论 0喜欢 0 通过LAContext evaluatedPolicyDomainState属性可以获取到当前data类型的指纹信息数据, ...

  3. 接口工具之postman

    在我们日常开发中,经常会对功能接口进行相应的测试.那么postman是一款不错的测试工具,因为平常使用的比较多,因此在这里简单记录一下,经常使用到的一些地方 简单的使用就不错介绍了, 基本流程: 新建 ...

  4. PHP优化与提升

    一.十个不错的建议 1.使用 ip2long() 和 long2ip() 函数来把 IP 地址转化成整型存储到数据库里.这种方法把存储空间降到了接近四分之一(char(15) 的 15 个字节对整形的 ...

  5. SSH上传/下载本地文件到linux服务器

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件 scp username@servername:/path/filename /var/www/local_dir(本 ...

  6. freemarker数值格式化

    语法:number?string(exp) 说明:根据给定的格式化表达式将数值格式化为字符串. 参数:格式化字符串,"0"表示固定占位(至少有这个位数,不足位数用0代替),&quo ...

  7. 将表单数据转换为json代码分享

    <body> <form action="#" method="post" id="form1"> <inpu ...

  8. Angular 基本指令

    <!DOCTYPE html><html ng-app><head lang="en"> <meta charset="UTF- ...

  9. 校园电商项目(1) 基于SSM

    第一步:搭好环境 我这里使用Eclipse做本次的项目,tomcat.maven啥的怎么弄就跳过了ヾ(o・ω・)ノ 第二步:创建工程 我们首先创建一个maven项目,选择最后一个,创建完之后发现报错, ...

  10. Django的分页和中间件

    一.分页 Django的分页器(paginator) view.py from django.shortcuts import render,HttpResponse # Create your vi ...