Page 1 of 2

Total process count for httpd on remote linux server

Posted: Wed Mar 09, 2016 10:04 am
by Beena_Jogin
Hi,

How to monitor the total httpd process count on remote Linux server using nagios XI.

I tried using NRPE .. It doesn't seem to be working.

How to use check_nrpe with check_procs for total count on remote Linux server

Please help

Thanks,
Beena

Re: Total process count for httpd on remote linux server

Posted: Wed Mar 09, 2016 10:17 am
by lmiltchev
Examples:

Code: Select all

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_procs -a '-w 200 -c 250'
PROCS OK: 136 processes

[root@localhost ~]# /usr/local/nagios/libexec/check_nrpe -H x.x.x.x -c check_procs -a '-a /usr/sbin/httpd'
PROCS OK: 9 processes with args '/usr/sbin/httpd'
The commands are run from the CLI on the Nagios XI server. The "x.x.x.x" is the IP address of the remote box. Hope this helps.

Re: Total process count for httpd on remote linux server

Posted: Wed Mar 09, 2016 10:25 am
by Beena_Jogin
I am using the following command

[root@Nagiosserver libexec]# ./check_nrpe -H <IP address> -c check_procs -a httpd

NRPE: Unable to read output

Re: Total process count for httpd on remote linux server

Posted: Wed Mar 09, 2016 10:59 am
by Beena_Jogin
Hi,

Thanks for your help. The commands didn't work.. I am getting the same error

NRPE: Unable to read output

Is there any thing to be checked on remote host?

Re: Total process count for httpd on remote linux server

Posted: Wed Mar 09, 2016 11:07 am
by rkennedy
From the client machine, can you please post your /etc/xinetd.d/nrpe file? There seems to be an issue with NRPE connecting.

Re: Total process count for httpd on remote linux server

Posted: Thu Mar 10, 2016 7:27 am
by Beena_Jogin
There is no such file or dir existing.

I think something wrong with the NRPE installation?

Re: Total process count for httpd on remote linux server

Posted: Thu Mar 10, 2016 10:12 am
by lmiltchev
There is no such file or dir existing.

I think something wrong with the NRPE installation?
How did you install NRPE on the remote machine? Did you follow our official documentation?

https://assets.nagios.com/downloads/nag ... _Agent.pdf

If for some reason NRPE didn't install properly the first time around, you can try reinstalling it by running the "fullinstall" script one more time. Let us know if you get stuck on something.

Re: Total process count for httpd on remote linux server

Posted: Fri Mar 11, 2016 9:03 am
by Beena_Jogin
The earlier NRPE installation seems to have a problem then.

Should we uninstall and install it again. Please provide us the Uninstallation steps. Are there any particular steps we need to take care during uninstallation?
As this was a critical server for customers, we want nothing to go wrong.

Thanks,
Beena

Re: Total process count for httpd on remote linux server

Posted: Fri Mar 11, 2016 10:26 am
by lmiltchev
Should we uninstall and install it again. Please provide us the Uninstallation steps. Are there any particular steps we need to take care during uninstallation?
As this was a critical server for customers, we want nothing to go wrong.
We don't have an "official" uninstaller for NRPE and nagios plugins. I wouldn't recommend rushing into removing NRPE yet as we don't have enough information. You didn't tell us how NRPE was installed. Did you use our installer script or you compiled it yourself? Installed from a repo...?

If you used our installer, you could simply run the following commands to remove NRPE and nagios plugins:

Code: Select all

delgroup nagios
deluser nagios
rm -f /etc/xinet.d/nrpe
service xinetd restart
rm -rf /usr/local/nagios
Word of caution: This will delete any custom commands and plugins that you might have!

Before you attempt to remove NRPE, let's take a look at some of your settings.

1. What kind of system is this (OS/distro/architecture)?

2. Show us the "check_procs" definition. It is probably in "/usr/local/nagios/etc/nrpe/common.cfg" or "/usr/local/nagios/etc/nrpe.cfg". Your paths may be different, depending on the distro that you are using.

3. What is the full path to the nagios plugins on your system?

4. Run the following commands, and show the output:

Code: Select all

find / -name nrpe
ps axuw | grep nrpe
netstat -at | grep nrpe
5. Post the "nrpe.cfg" file.

Re: Total process count for httpd on remote linux server

Posted: Mon Mar 14, 2016 8:39 am
by Beena_Jogin
Please find below answers:
1. What kind of system is this (OS/distro/architecture)?

[[email protected] ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)

[[email protected] nagios]# uname -mrs
Linux 2.6.18-406.el5 x86_64

[[email protected] nagios]# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.11 (Tikanga)
Release: 5.11 : Tikanga

[[email protected] tmp]# cat /proc/version
Linux version 2.6.18-406.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-55)) #1 SMP Fri May 1 10:37:57 EDT 2015


2. Show us the "check_procs" definition. It is probably in "/usr/local/nagios/etc/nrpe/common.cfg" or "/usr/local/nagios/etc/nrpe.cfg". Your paths may be different, depending on the distro that you are using.
Common.cfg is located in below path:

[[email protected] nrpe.d]# pwd
/etc/nrpe.d
[[email protected] nrpe.d]# ls -ltr
total 4
-rw-r--r-- 1 nrpe nrpe 1279 Sep 9 2015 common.cfg

[[email protected] nrpe.d]# cat common.cfg|grep check_procs
command[check_all_procs]=/usr/lib64/nagios/plugins/custom_check_procs
command[check_procs]=/usr/lib64/nagios/plugins/check_procs $ARG1$

nrpe.cfg is located in below path:

[[email protected] nagios]# pwd
/etc/nagios
[[email protected] nagios]# ls -ltr
total 8
-rw-r--r-- 1 root root 7995 Sep 9 2015 nrpe.cfg
[[email protected] nagios]# cat nrpe.cfg|grep -i "check_procs"
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 150 -c 200
#command[check_procs]=/usr/lib64/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

3. What is the full path to the nagios plugins on your system?
[[email protected] plugins]# pwd
/usr/lib64/nagios/plugins
[[email protected] plugins]# ls -ltr|wc -l


output of commands -

[[email protected] ~]# find / -name nrpe
/etc/sysconfig/nrpe
/etc/rc.d/init.d/nrpe
/var/lock/subsys/nrpe
/var/run/nrpe
/usr/sbin/nrpe

[[email protected] ~]# ps axuw | grep nrpe
nrpe 8555 0.0 0.0 40004 868 ? Ss Mar09 0:02 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
root 29601 0.0 0.0 61232 788 pts/1 S+ 06:25 0:00 grep nrpe

[[email protected] ~]# netstat -at | grep nrpe
getnameinfo failed

Thanks