Errors on the Nagios Server

Hello,

I have Nagios server and I have a host that I did connect with Nagios server

the problem is I receive this messages on Nagios server

Current Load CRITICAL
Current Users CRITICAL
Root / Partition CRITICAL
SWAP Uasge CRITICAL
Total Processes CRITICAL

For the host I did add I don't know how to solve this ?

Best Regards

Is this a web server and you are monitoring web apps?

Hell @Neo it's just a Debian Linux machine to test Nagios

so the server is 192.168.50.90
The client is 192.168.50.120

ok

And what is the content of this file?

/usr/local/nagios/etc/servers/remote_host.cfg

define host{

            use                     linux-server
            host_name               Toby
            alias                   Toby
            address                 192.168.50.120

}

define hostgroup{

            hostgroup_name          linux-server
            alias                   Linux Servers
            members                 Toby
}

define service{

            use                     local-service
            host_name               Toby
            service_description     SWAP Uasge
            check_command           check_nrpe!check_swap

}

define service{

            use                     local-service
            host_name               Toby
            service_description     Root / Partition
            check_command           check_nrpe!check_root

}

define service{

            use                     local-service
            host_name               Toby
            service_description     Current Users
            check_command           check_nrpe!check_users

}

define service{

            use                     local-service
            host_name               Toby
            service_description     Total Processes
            check_command           check_nrpe!check_total_procs

}

define service{

            use                     local-service
            host_name               Toby
            service_description     Current Load
            check_command           check_nrpe!check_load

}


Honestly I did follow this

SO I can be able to add this host to my Nagios Server I don't if there is a better way to do this ?

Maybe you should edit /usr/local/nagios/etc/nrpe.cfg, which is the file which contains these definitions:

command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10
command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
command[check_root]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w 20% -c 10%
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200

or better yet, you can read the docs on each of these default plugins.

https://support.nagios.com/kb/article/nrpe-configuring-nrpe-commands-to-accept-arguments-759.html

Normally, it is a good idea to review the parameters of the plugin definitions and to tweak them based on your application.

See also:

https://support.nagios.com/kb/article/nrpe-v3-check_nrpe-config-file-517.html

and also:

https://support.nagios.com/kb/article/nrpe-agent-and-plugin-explained-612.html

HTH

The nrpe.cfg exists on the target host(s).

Do you have

# .check_nrpe. command definition
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
}

in your commands.cfg (on the Nagios server)?
The given check_nrpe (binary) must be present.

yes I have it

This is what I have when I click on any of there errors

CHECK_NRPE: (ssl_err != 5) Error - Could not complete SSL handshake with 192.168.50.120

Hello,

SSL negotiation and handshake errors with NRPE are one of those things that can mean what they say they mean, but very often (usually, in my experience) mean something else entirely. Your best bet here would be to have a good look through the Nagios logs on the Nagios server, and the syslog on the client that's running NRPE, to see if there's anything in there that might shed any light on why this is failing. You can also try manually running the full check_nrpe command on the Nagios server, as the Nagios user, and see for yourself what happens when it tries to execute.

I solved some of the problem but now I have this problem

NRPE: Command 'check_root' not defined
NRPE: Command 'check_swap' not defined

Another question on my localhost I have all the services like

SSH,Ping,HHTP I can see it only for localhost on my Nagios why I can't see it for the new Host or how can I add it to the new host ?

The commands that NRPE knows and can be asked to execute by Nagios are defined in its own local configuration file. This is called nrpe.cfg, and will exist in whatever location your packaged version of NRPE installed it to. Normally this is /etc/nrpe.cfg, /etc/nagios/nrpe.cfg, or some other equivalent beneath /usr/local or /opt.

But either way, your NRPE installation's nrpe.cfg file defines the commands it knows and what it should do when it receives them. So these "not defined" messages mean that NRPE does not have definitions for the check_root and check_swap commands in its configuration file.

Regarding adding hosts to be monitored to your Nagios server: this is usually done via the hosts.cfg (and potentially also the hostgroups.cfg) file. You define hosts in here, and then define the checks to be executed against those hosts and host groups in your services.cfg file. You can define your own configuration files, and it is possible that these files are called something different in your install, but you can see what configuration files your Nagios server loads (or what directories it reads for include purposes) by examining the master nagios.cfg file.

Hope this helps ! I've got no Nagios server to hand to test things with, so all of the above is just based on memory - albeit the memory of administering Nagios servers for many, many years in my previous roles ! But hopefully some of the above is enough to point you in the right direction.