I have some trouble configuring a Linux remote host with my Nagios Server which is working properly.
I performed a research before posting but the answers I’ve found didn’t help me so much. So please help me if it is possible.
This is the configuration:
Nagios Server:
OS: Gentoo Linux x86_64
Kernel: 2.6.34-hardened-r6
Nagios: 3.2.3
The Nagios server sees the client up and running in the Map section but the Problems->Services section shows the following messages:
Current Load CRITICAL 05-18-2011 10:03:03 5d 13h 41m 11s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
Root Partition CRITICAL 05-18-2011 10:03:34 5d 13h 39m 59s 3/3 (Return code of 127 is out of bounds - plugin may be missing)
The Event Log section reports:
[05-18-2011 10:03:36] Warning: Return code of 127 for check of service 'Root Partition' on host 'centralino' was out of bounds. Make sure the plugin you're trying to run actually exists.
[05-18-2011 10:03:06] Warning: Return code of 127 for check of service 'Current Load' on host 'centralino' was out of bounds. Make sure the plugin you're trying to run actually exists.
These are the two sections I added to the file /etc/nagios/objects/nrpe-command.cfg:
[code]define service {
use generic-service
host_name centralino
service_description Current Load
check_command check_nrpe!check_load
}
define service {
use generic-service
host_name centralino
service_description Root Partition
check_command check_nrpe!check_disk
}[/code]
How are you trying to run the checks on the remote host? nrpe? nsca? check_by_ssh?
Did you install the plugins on the remote host? can you run the plugins on the client itself and get results?
I installed nrpe on the remote host following this guide in particular: Installing NRPE (Nagios Client) on CentOS 5.
Then, when I saw those warnings I uninstalled them and reinstalled using yum, but the results are the same.
Maybe I have to perform some check in the remote host, both as regard the configuration and the installed plugins.
Of course yes, but before making the new installation directly using yum, I was bumped in the problem also described in the guide mentioned above:
CHECK_NRPE: Error - Could not complete SSL handshake.
or
CHECK_NRPE: Error receiving data from daemon.
When I tried to perform the check_nrpe test from the Nagios server:
first i’d recommend you don’t use yum/aptitude or whetever rpm manager, they tend to put files in driectories known only to themselves…
So starting from source is usually better.
I don’t have an nrpe install running but i will try it myself as soon as i have the time to set it up…
I seem to remember there was some official docs on NRPE but i can’t find them, they restyled the site and those docs seem to bemissing. did you try a search here on the forum? i think Jakkedup wrote somehting about it a while ago.
OK, so I am going to remove nrpe and the plugins I installed with yum and reinstall from sources as I did the first time.
As regard the official documentation, I found it a little bit dispersive and unfriendly.
Of course I’ve searched in the forum.
I will let you know as soon as I install the nrpe plugin again from sources. Thanks.
OK,
here again after installing the nrpe and nagios-plugins again from sources on the remote host.
Well, if I perform the following command on the remote host:
I get:
But if I perform this command from the server:
I get:
So I think this is good for the moment. Isn’t it?
As regard the error on the remote host, as this guide says, I can try to issue the following command:
which gives me the message:
Well, this is because my config files only allow one server to talk to it. But even if I put also the localhost IP address in the allow from clause, it says connection refused. Anyway, maybe this is less important, since it is possible to successfully perform the test from the Nagios server.
as i said i don’t have nrpe so i can’t try it. are you sure the nrpe client can reach the plugins? are there any permission settings you need to apply to have the plugins executabel by nrpe?
Maybe I still have some confusion in mind. When it says the plugin is not installed, it refers to the client or to the server? I suppose the client, since the two service mentioned above are properly working on the nagios server (i.e. Current Load and Root Partition). If it refers to the client (i.e. the remote host), I think the plugins are installed.
If I did understand correctly the plugins should be the following: check_load and check_disk.
Well, on the remote host (but also on the Nagios Server) I have both:
By the way, also a friend of mine told me the nrpe daemon should be only at the remote host (even if I remember correctly!)
Well the nrpe configuration on the client side consists in the following files:
[list]]/etc/xinetd.d/nrpe/:m] ]/usr/local/nagios/etc/nrpe.cfg/:m][/list:u]
And of course the /etc/services file which is configured as well.
My impression is that nrpe is working properly but doesn’t see the plugins. In this case I don’t know where to check.
EDIT: nrpe should know where check_load and check_disk are since there are these two lines in the /usr/local/nagios/etc/nrpe.cfg file:
Maybe I’ve found out where the problem is.
The path in /etc/nagios/objects/remote/nrpe-commands.cfg for check_nrpe (on the server side) was incorrect.
Now I set this one:
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
and the check_load works.
Now I only have the problem to have also the check_disk working.
Actually I’ve defined two services in the /etc/nagios/objects/remote/nrpe-services.cfg file:
[code]define service {
use generic-service
host_name centralino
service_description Current Load
check_command check_nrpe!check_load
}
define service {
use generic-service
host_name centralino
service_description Root Partition
check_command check_nrpe!check_disk
}[/code]
But only the check_load works. The Nagios web gui says:
Furthermore I defined another check (check_asterisk) but this is another issue that I will discuss later on.
EDIT: SOLVED! I had to change the Root Partition service as it follows:
define service {
use generic-service
host_name centralino
service_description Root Partition
check_command check_nrpe!check_hda1
}
Furthermore, on the remote host side, I had to modify the following line:
to
in the /usr/local/nagios/etc/nrpe.cfg file.
Now I’m able to monitor the Root Partition satus and the system workload too!