Page 3 of 6

Re: Check Script not able to run

Posted: Tue May 24, 2016 6:23 am
by WillemDH
Try:

Code: Select all

su nagios -c '/etc/nagios/nrpe.d/check_mem -uC -w 70 -c 90'

Re: Check Script not able to run

Posted: Tue May 24, 2016 10:27 am
by rkennedy
Thanks @WillemDH!

@cyberportnoc - let us know the results when you get a chance to run the command.

Re: Check Script not able to run

Posted: Tue May 24, 2016 8:12 pm
by cyberportnoc
Hi,

[root@rhel64-02 ~]# su nagios -c '/etc/nagios/nrpe.d/check_mem -uC -w 70 -c 90'
This account is currently not available.

Please take a look

Thanks,
Kelvin

Re: Check Script not able to run

Posted: Tue May 24, 2016 8:42 pm
by Box293
cyberportnoc wrote:Dear Box,

There are no nagios user exist in server.
It is run by nrpe process

[root@rhel64-02 ~]# cat /etc/passwd | grep nagios
nagios:x:498:499::/var/spool/nagios:/sbin/nologin
[root@rhel64-02 ~]# cat /etc/passwd | grep nrpe
nrpe:x:497:498:NRPE user for the NRPE service:/var/run/nrpe:/sbin/nologin
[root@rhel64-02 ~]# su nrpe
This account is currently not available.
[root@rhel64-02 ~]#

Please advise.

Thanks,
Kelvin
Box293 wrote:What is the output of:

Code: Select all

su nrpe -c '/etc/nagios/nrpe.d/check_mem -uC -w 70 -c 90'
Here we can see that the nrpe account is not letting the plugin run.

Do any checks work for this host via nrpe? If so, show us which one in the nrpe.cfg works?

Re: Check Script not able to run

Posted: Tue May 24, 2016 10:24 pm
by cyberportnoc
Dear Box,

[root@ccnagios01 libexec]# ./check_nrpe -H 192.168.38.144 -c nagios_cpu
OK
user: 0%, system: 0%, iowait: 0%, idle: 100%
| cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%;

Please give it a check.

Thanks,
Kelvin

Re: Check Script not able to run

Posted: Tue May 24, 2016 10:50 pm
by Box293
On the NPRE client, can you please show us the contents of the file:
/etc/sudoers
Also, any files in /etc/sudoers.d/

Re: Check Script not able to run

Posted: Tue May 24, 2016 11:39 pm
by cyberportnoc
Dear Box,

Below are those information:
[root@rhel64-02 ~]# cat /etc/sudoers

Defaults always_set_home
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS"
Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
root ALL=(ALL) ALL
%nrpe ALL=(ALL) NOPASSWD: /etc/nagios/nrpe.d/nagios_guest_sudo.sh

[root@rhel64-02 ~]# ls /etc/sudoers.d/
[root@rhel64-02 ~]#

Please give it a check.

Thanks,
Kelvin

Re: Check Script not able to run

Posted: Wed May 25, 2016 12:22 pm
by tgriep
Can you login to the Nagios server, run the following commands and post the output?
./check_nrpe -H 192.168.38.144 -c nagios_memory
./check_nrpe -H 192.168.38.144 -c nagios_guest_memory
./check_nrpe -H 192.168.38.144 -c nagios_cpu
Also, can you post where you downloaded the check_mem plugin from so we can review it?

Re: Check Script not able to run

Posted: Wed May 25, 2016 8:31 pm
by cyberportnoc
[root@ccnagios01 libexec]# ./check_nrpe -H 192.168.38.144 -c nagios_memory
NRPE: Unable to read output
[root@ccnagios01 libexec]# ./check_nrpe -H 192.168.38.144 -c nagios_guest_memory
OK
xcpack01 - 2%
xcpalx03 - 4%
xcpalx39-new - 2%
| xcpack01=2%;0;100; xcpalx03=4%;0;100; xcpalx39-new=2%;0;100;
[root@ccnagios01 libexec]# ./check_nrpe -H 192.168.38.144 -c nagios_cpu
OK
user: 0%, system: 0%, iowait: 0%, idle: 100%
| cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%;

In the other hand, is it any plugin of memory check which are able ignore "cached memory"
Please advise.

Thanks,
Kelvin

Re: Check Script not able to run

Posted: Thu May 26, 2016 1:07 am
by cyberportnoc
If there are another memory script which can ignore the cached memory.

I can replace to use that.

Please advise.

Thanks,
Kelvin