nagios客户端安装设置

下载安装包

cd /opt
wget http://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
wget https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.0.tar.gz

安装依赖包

yum install -y gcc glibc make cmake glibc-common gd gd-devel php perl-devel mysql-server

编译安装nagios-plugins

cd /opt/nagios-plugins-2.1.2
./configure --prefix=/usr/local/nagios
make && make install && echo $?

编译安装nrpe

cd /opt/nrpe-3.2.1
./configure --prefix=/usr/local/nagios --enable-command-args
make all
#添加nagios用户
make install-groups-users
#安装
make install
#添加主配置文件
make install-config
#配置xinetd
make install-inetd
#设置nrpe管理命令
make install-init
#编译插件
make check_nrpe
#安装插件
make install-plugin

配置

#先备份
cp /usr/local/nagios/etc/nrpe.cfg{,.bak}
#修改配置文件
vim /usr/local/nagios/etc/nrpe.cfg
#将hda1改为sda1

command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1

启动nrpe

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

服务器端

#生成配置文件(建议cp原因的配置文件进行修改)(这里以test命名,建议用主机名命名)
cd /usr/local/nagios/etc/servers/
vim test.cfg

#
# HOST  DEFINITION
#
define host{
        use                     linux-server            ; Name of host template to use
                                                        ; This host definition will inherit all variables that are defined
                                                        ; in (or inherited by) the linux-server host template definition.
        host_name               test #客户端主机名
        alias                   test
        address                 客户端IP地址
        }
#
# HOST GROUP DEFINITION
#
define hostgroup{
        hostgroup_name  test; The name of the hostgroup
        alias           test; Long name of the group
        members         test     ; Comma separated list of hosts that belong to this group
        }
#
# service DEFINITION
#
define service{
        use                             local-service         ; Name of service template to use
        host_name                       test
        service_description             Root Partition
        check_command                   check_local_disk!20%!10%!/
        }
define service{
        use                             local-service         ; Name of service template to use
        host_name                       study
        service_description             Root Partition
        check_command                   check_local_disk!20%!10%!/
        }
            ......              

重新读取配置文件

systemctl reload nagios

原文地址:http://blog.51cto.com/13323775/2085635

时间: 2024-10-12 21:00:50

nagios客户端安装设置的相关文章

nagios客户端安装:

nagios客户端安装: 环境准备和服务端相差无几,按照服务端的准备即可,但无需lamp 环境: !!!安装插件nagios-plugins-1.4.16.tar.gz .nrpe-2.12.tar.gz 与服务端一致 #安装一个系统性能的命令 yum install sysstat -y #安装监控的插件 tar zxf Params-Validate-0.91.tar.gz cd Params-Validate-0.91perl Makefile.PLmake make install ta

nagios客户端安装与配置windows篇

一.被监控的windows xp客户端的配置 1.安装NSClient++并安装下载地址: http://sourceforge.net/projects/nscplusNSClient++-0.3.8-Win32.msi  NSClient++-0.3.8-x64.msi 2.安装NSClient++双击安装 -> next -> 同意 -> next  -> next -> next -> 设置允许IP,设置密码(这里密码一般可以不设置),Modules to lo

nagios客户端安装监控

1.在客户端机器上安装epel扩展源 yum install -y epel-release2.yum安装nagios及依赖包软件 yum install -y nagios-plugins nagios-plugins-all nrpe nagios-plugins-nrpe3.编辑nrpe配置文件 vim /etc/nagios/nrpe.cfg修改如下:(1)将allowed_hosts=127.0.0.1改为allowed_hosts=127.0.0.1,192.168.81.131.其

LINUX中nagios客户端安装步骤及遇到问题

需安装的软件及插件 服务端服务器 a      nagios-3.2.3,nagios-cn-3.2.3汉化版 nagios-plugins-1.4.15 客户端服务器 b       nrpe-2.12:nagios-plugins-1.4.15 第一步:先创建账号和组 (注意:先确认有没有账号和组,如果没有则需要先创建,若未创建后续无法继续) 第二步:把安装包nrpe-2.12:nagios-plugins-1.4.15 上传至客户端b中,在/usr/local/src中进行解压. 安装na

nagios客户端安装

在被监控服务器(Linux/unix)上安装Nagios-plugins和nrpe 1.添加用户 1 2 ; html-script: false ]/usr/sbin/useradd -m nagios passwd nagios 2.解压安装nagios-plugins 1 2 3 4 ; html-script: false ]cd /usr/local/src/tarbag wget http://downloads.sourceforge.net/project/nagiosplug/

zabbix windows客户端安装设置及服务器邮件通知设置

http://www.zabbix.com/downloads/2.4.4/zabbix_agents_2.4.4.win.zip 1.修改文件 D:\zabbix\zabbix_agents_2.4.4.win\conf\zabbix_agentd.win.conf LogFile=c:\zabbix_agentd.log Server=10.173.230.158 ServerActive=10.173.230.158 Hostname=platform-web1 2.安装agent >D:

Nagios配置安装详解

nagios.html :first-child{margin-top:0!important}img.plugin{box-shadow:0 1px 3px rgba(0,0,0,.1);border-radius:3px}iframe{border:0}figure{-webkit-margin-before:0;-webkit-margin-after:0;-webkit-margin-start:0;-webkit-margin-end:0}kbd{border:1px solid #a

nagios一键安装脚本V1.0(客户端+服务端)

服务端脚本: #!//bin/bash #nagios一键安装脚本 path=`pwd` yum_user() { echo -e "\033[32m开始安装基础支持套件和添加用户......\033[0m" yum -y install httpd gcc glibc glibc-common gd gd-devel  if [ $? -ne 0 ] then    echo -e "\033[31mYUM安装失败!\033[0m"   exit 1 fi ech

关于Nagios的NRPE服务端客户端安装

Nagios 安装 准备条件: Development Libraries Development  Tools 解决依赖关系: httpd gcc glibc glibc-common gd gd-devel php mysql mysql-server 开始 [[email protected] Desktop]  groupadd nagcmd [[email protected] Desktop] useradd  -G nagcmd nagios [[email protected]