Page 1 of 3
In Nagios GUI getting Critical errors
Posted: Fri Dec 06, 2019 8:44 am
by dheerushops
In Nagios server GUI. Getting below error for Remote servers. For alerts CPU, FTP,SSH.
No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, ...) failed. errno is 2: No such file or directory
Re: In Nagios GUI getting Critical errors
Posted: Fri Dec 06, 2019 12:00 pm
by benjaminsmith
Hello
@dheerushops,
The plugin is missing for some reason, perhaps in the wrong path. What is the output of the following commands?
Verify the plugin is in the right location:
Check the permissions:
Code: Select all
ls -l /usr/local/nagios/libexec/check_nrpe
Re: In Nagios GUI getting Critical errors
Posted: Tue Dec 10, 2019 9:57 am
by dheerushops
[root@nagiosserver ~]# find / -name check_nrpe
/tmp/nrpe-2.15/nrpe-2.15/src/check_nrpe
/usr/local/nagios/libexec/check_nrpe
[root@nagiosserver ~]# ls -l /usr/local/nagios/libexec/check_nrpe
-rwxr-xr-x 1 root root 76785 Dec 6 08:52 /usr/local/nagios/libexec/check_nrpe
[root@nagiosserver ~]#
Re: In Nagios GUI getting Critical errors
Posted: Tue Dec 10, 2019 9:58 am
by dheerushops
Given output is from Nagios monitoring server
Re: In Nagios GUI getting Critical errors
Posted: Tue Dec 10, 2019 10:09 am
by dheerushops
Below output is from nagios client host.
[root@nagioshost~]# find / -name check_nrpe
/usr/local/nagios/libexec/check_nrpe
/root/nagios/nrpe-2.15/src/check_nrpe
[root@nagioshost~]#
[root@nagioshost~]# ls -l /usr/local/nagios/libexec/check_nrpe
-rwxrwxr-x 1 nagios nagios 76777 Dec 3 13:21 /usr/local/nagios/libexec/check_nrpe
[root@nagioshost~]#
Re: In Nagios GUI getting Critical errors
Posted: Tue Dec 10, 2019 4:30 pm
by benjaminsmith
Hello,
This looks like the problem. The permissions on check_nrpe are set to root on the Nagios server.
/usr/local/nagios/libexec/check_nrpe
[root@nagiosserver ~]# ls -l /usr/local/nagios/libexec/check_nrpe
-rwxr-xr-x 1 root root 76785 Dec 6 08:52 /usr/local/nagios/libexec/check_nrpe
Run the following to corret and try once more.
Code: Select all
chmod 775 /usr/local/nagios/libexec/check_nrpe
chown nagios:nagios /usr/local/nagios/libexec/check_nrpe
Re: In Nagios GUI getting Critical errors
Posted: Wed Dec 11, 2019 9:00 am
by dheerushops
For Nagios host getting below errors in Nagios monitoring tool.
nagioshost
FTP Monitoring
CRITICAL 12-11-2019 08:45:13 7d 19h 43m 3s 3/3 NRPE: Command 'check_ftp' not defined
SSH Monitoring
CRITICAL 12-11-2019 08:46:28 7d 19h 41m 48s 3/3 NRPE: Command 'check_ssh' not defined
Total Processes
CRITICAL 12-11-2019 08:47:43 7d 19h 40m 33s 3/3 PROCS CRITICAL: 263 processes
Re: In Nagios GUI getting Critical errors
Posted: Wed Dec 11, 2019 12:49 pm
by lmiltchev
It seems like the 'check_ftp' and 'check_ssh' commands are not defined in nrpe.cfg on the client machine... You will have to define them on remote box, and restart the nrpe service. Then, you can run your checks again from the command line on the nagios server to see if the issue has been resolved.
Re: In Nagios GUI getting Critical errors
Posted: Wed Dec 11, 2019 12:52 pm
by dheerushops
I have added entries in file " /usr/local/nagios/etc/services.cfg"
define service{
use generic-service
host_name nagioshost
service_description SSH Monitoring
check_command check_nrpe!check_ssh
}
define service{
use generic-service
host_name nagioshost
service_description FTP Monitoring
check_command check_nrpe!check_ftp
Re: In Nagios GUI getting Critical errors
Posted: Wed Dec 11, 2019 1:35 pm
by lmiltchev
Well, you defined you services on the nagios server, but you haven't defined you commands on the remote machine (the host that you are monitoring)...
Here's an example of a command definition that can be placed in your nrpe.cfg file on the client machine:
Code: Select all
command[check_ftp]=/usr/local/nagios/libexec/check_ftp -H $ARG1$ -p $ARG2$
After saving the file, and restarting nrpe on the remote box, so that changes can take effect:
you can test your check by running the following command on the nagios server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_ftp -a '<ip address of your FTP server>' '<port number>'
In this example, you are passing 2 arguments - FTP server's IP address and a port number.
Example:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 192.168.x.x -c check_ftp -a '192.168.y.y' '21'
FTP OK - 0.002 second response time on 192.168.y.y port 21 [220 (vsFTPd 2.2.2)]|time=0.001744s;;;0.000000;10.000000
Bottom line: when you use check_nrpe you pass your command with the "-c" flag. The command is defined on the remote box (host that you are monitoring). You pass arguments if needed, using the "-a" flag.
Code: Select all
./check_nrpe -H <client ip> -c <command> -a <arguments>
Does this make sense?