Page 1 of 1
httpd process monitoring on remote linux server
Posted: Wed Apr 06, 2016 8:50 am
by Beena_Jogin
Hi,
We are trying for httpd process monitoring on the remote Linux server.
command:
/usr/local/nagios/libexec ./check_nrpe -H <remote host IP> -c check_procs -a httpd
This command is giving the value of total process, and not httpd.
is there any other command. How to make check_procs work with nrpe
Please assist.
Re: httpd process monitoring on remote linux server
Posted: Wed Apr 06, 2016 10:45 am
by bwallace
Add the server to Nagios XI using the Linux Server wizard and check the box next to httpd towards the bottom of the 'step 2' page (see screenshot below). When finished with the wizard, you can find the check_command under Core Config Manager > Services > Service Description = Apache Web Server, under the Actions column click 'View Text Config'
the check_command will show up as:
check_nrpe!check_init_service!-a 'httpd'
.
Re: httpd process monitoring on remote linux server
Posted: Wed Apr 06, 2016 11:44 am
by Beena_Jogin
Thanks,
I configured this.
But we want to know the total count of httpd process running and if it exceeds a certain value like 50, it should giving warning notification and if it reached 250 it should be critical.
How can this be done?
Can we write a custom service for this?
Thanks,
Beena
Re: httpd process monitoring on remote linux server
Posted: Wed Apr 06, 2016 12:53 pm
by lmiltchev
Verify that you have the following command defined in the nrpe.cfg or common.cfg file on the client (remote box):
Code: Select all
command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$
BTW, what is the version of the check_procs plugin that you are currently using?
Code: Select all
/usr/local/nagios/libexec/check_procs -V
Test your check from the command line on the Nagios XI server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_procs -a '-a httpd -w 50 -c 250'
If it works as expected, modify your current check or create a new service. Let us know if you have any more questions/issues.
Re: httpd process monitoring on remote linux server
Posted: Thu Apr 07, 2016 7:05 am
by Beena_Jogin
Thanks for this. It worked. It is giving me 9 procs.
But in the remote host it shows as 10.
I am wondering if the command
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_procs -a '-a httpd -w 50 -c 250'
takes into account Apache web server?
Thanks,
Beena
Re: httpd process monitoring on remote linux server
Posted: Thu Apr 07, 2016 9:14 am
by WillemDH
You could give this plugin a try:
https://github.com/willemdh/check_lin_process
I allows you to add min and max for a process and it also returns memory and cpu usage in percentage.
Grtz
Re: httpd process monitoring on remote linux server
Posted: Thu Apr 07, 2016 10:56 am
by rkennedy
Thanks @WillemDH!
@Beena_Jogin - can you show us the full output of a ps -ef on the remote machine, and the full input / output of the command running on Nagios? It might be counting using grep.
Re: httpd process monitoring on remote linux server
Posted: Thu Apr 07, 2016 11:06 am
by lmiltchev
Thanks for this. It worked. It is giving me 9 procs.
But in the remote host it shows as 10.
I am not sure how this is possible... The "check_nrpe" calls "check_procs" command, which is run locally on the client. Running this command on the client (remote box):
Code: Select all
/usr/local/nagios/libexec/check_procs -a httpd
should give you the same number of processes as this command:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_procs -a '-a httpd'
ran on the Nagios XI server.
BTW, you can also give Willem's plugin a try to see if it is going to work better.
Let us know if we answered your questions.