Page 2 of 7
Re: NRPE Chcek_Memory on Linix
Posted: Tue Aug 16, 2016 11:20 am
by tgriep
I copied the link incorrectly for the NRPE article. I did fix the previous posts but here it is.
https://support.nagios.com/kb/article.php?id=515
Re: NRPE Chcek_Memory on Linix
Posted: Tue Aug 16, 2016 8:10 pm
by kwhogster
rkennedy
created the command for the local host
now getting this error No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_mem.sh, ...) failed. errno is 2: No such file or directory
My Command
Code: Select all
define command{
command_name check_mem
command_line $USER1$/check_mem.sh
}
My Service
Code: Select all
# DEfine a service to check Mem usage on local machine
define service{
use local-service
host_name localhost
service_description Check Memory Usage
check_command check_mem
servicegroups MemUsage
notifications_enabled 0
}
Thoughts?
Re: NRPE Chcek_Memory on Linix
Posted: Tue Aug 16, 2016 8:39 pm
by kwhogster
Om My VMA host with the instructions I got NRPE Daemon running nrpe config set allowed hosts dont_blame_nrpe=1
now Nagios is reporting this NRPE: Command 'check_mem' not defined
From Command Line
nagios@tgcs017:/usr/local/nagios/etc/objects$ /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.7 -t 30 -c check_mem -a ' -w 80% -c 90%'
NRPE: Command 'check_mem' not defined
Same error
Was getting Connection refused that is clear now
Thoughts
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 10:10 am
by lmiltchev
Can you post the nrpe.cfg file from the vMA host? Also, show the full path to the "check_mem.sh" script on the vMA host.
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 12:42 pm
by kwhogster
find . -name check_mem.sh
do not find that file on the VMA host
I think it is on the Nagios host
see nrpe.cfg it is attached
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 2:05 pm
by lmiltchev
nagios@tgcs017:/usr/local/nagios/etc/objects$ /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.7 -t 30 -c check_mem -a ' -w 80% -c 90%'
NRPE: Command 'check_mem' not defined
Let's clarify this. You are running the above command on your nagios server against the VMA host (10.2.8.7). This means that the "check_mem" command must be defined in the nrpe.cfg file on the client AND the "check_mem.sh" must exist in the plugins directory on the client...
Run the following commands and show the output:
On the nagios server:
Code: Select all
/usr/lib/nagios/plugins/check_nrpe -H 10.2.8.7 -t 30 -c check_users
On the client (10.2.8.7):
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 3:21 pm
by kwhogster
/usr/lib/nagios/plugins/check_nrpe -H 10.2.8.7 -t 30 -c check_users
Results from Nagios Server
nagios@tgcs017:/usr/local/nagios/etc/objects$ /usr/lib/nagios/plugins/check_nrpe -H 10.2.8.7 -t 30 -c check_users
NRPE: Unable to read output
From VMA
vi-admin@tgkw002:~/tmp> ls -la /usr/local/nagios/libexec/
total 148
drwxrwxr-x 2 nagios nagios 4096 Aug 16 21:27 .
drwxr-xr-x 6 root root 4096 Aug 16 21:27 ..
-rwxrwxr-x 1 nagios nagios 137337 Aug 16 21:27 check_nrpe
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 4:05 pm
by lmiltchev
The only plugin I see in the "/usr/local/nagios/libexec/" directory is "check_nrpe"... I doesn't seem that you have nagios plugins installed, unless they are in a different directory. None of the checks, defined in the nrpe.cfg on the the VMA host would work as you are missing the plugins (see below; in bold):
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
In order to monitor a remote machine via NRPE, you need to have both, the agent (NRPE), and plugins as the checks are executed on the client.
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 5:49 pm
by kwhogster
How to I install the plugins on
SUSE Linux Enterprise Server 11 sp3
I tried this from the Nagios support site
vi-admin@tgkw002:~/tmp> sudo wget
http://prdownloads.sourceforge.net/sour ... .11.tar.gz
vi-admin's password:
--2016-08-17 18:47:07--
http://prdownloads.sourceforge.net/sour ... .11.tar.gz
Resolving prdownloads.sourceforge.net... 216.34.181.59
Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-08-17 18:47:07 ERROR 404: Not Found.
I got it installed now it was a bad url
Waiting for Nagios to update
Re: NRPE Chcek_Memory on Linix
Posted: Wed Aug 17, 2016 6:31 pm
by kwhogster
even after installing Nagios plugins
vi-admin@tgkw002:~/tmp/nagios-plugins-2.1.2> ls -la /usr/local/nagios/libexec
total 148
drwxrwxr-x 2 nagios nagios 4096 Aug 16 21:27 .
drwxr-xr-x 6 root root 4096 Aug 16 21:27 ..
-rwxrwxr-x 1 nagios nagios 137337 Aug 16 21:27 check_nrpe
vi-admin@tgkw002:~/tmp/nagios-plugins-2.1.2>
where did they go?
Also
On my Cento Os 7 it is working and do not have plugins installed there just the NRPE client.
SUSE is strange I think
On my Ubuntu 16.04.01 server where Nagios runs they are in /usr/lib/Nagios/plugins
Thoughts