2

I have ubuntu ec2 instance I want to monitor.I havent installed plugins on NRPE server which is using xinetd but instead I have configured and installed plugins on Nagios server.However except check_ssh nothing gets executed when I test from libexec directory from Nagios server.I have elasticsearch ,cassandra and tomcat plugins and my Boss doesnt want anything on ec2 instance except nrpe.I have already configured all these processes to accept any connections.

4

1 回答 1

1

我们可以有两种不同类型的主机检查:

  1. 直接检查(nagios -> 命令check_ping(HOSTADDRESS)-> 本地插件check_ping(HOSTADDRESS));

在这种情况下,第二台机器上不需要插件或 NRPE 或其他东西。Nagios 调用本地插件check_ping,它进行检查,Nagios 得到结果。您可以将这种类型的检查用于 PING、HTTP GET、SNMP 检查、SQL 查询等网络上可用的所有内容。

  1. NRPE 检查(nagios -> 命令check_nrpe(HOSTADDRESS,COMMAND)-> 本地插件check_nrpe(HOSTADDRESS,COMMAND)->(网络)-> NRPE 服务器命令COMMAND-> 本地(对于 NRPE)插件check_load

在这种情况下,Nagios 调用本地插件check_nrpe,该插件调用 NRPE 服务器,NRPE 服务器调用它自己的本地插件check_load并通过网络返回结果。在第二台机器上应该安装 NRPE 和 Nagios 插件,还nrpe.cfg应该包含必要的命令。您可以将此类型用于 CPU 负载、内存使用和磁盘空间监控,或创建自定义插件。

配置示例:

第一台机器(Nagios 服务器):

command部分:

define command{
        command_name    check_ping
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
        }

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

service部分:

define service{
        use                 network-service
        hostgroup_name      common-linux-servers
        service_description PING
        check_command       check_ping!100.0,20%!500.0,60%
        }

define service{
        use                     network-service
        hostgroup_name          common-linux-servers
        service_description     Current Load
        check_command           check_nrpe!check_load
        }

第二台机器/etc/nagios/nrpe.cfg

command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
于 2016-09-30T11:57:56.110 回答