httpd process monitoring on remote linux server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Beena_Jogin
Posts: 54
Joined: Fri Jan 22, 2016 4:58 am

httpd process monitoring on remote linux server

Post 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.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: httpd process monitoring on remote linux server

Post 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'

.
You do not have the required permissions to view the files attached to this post.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Beena_Jogin
Posts: 54
Joined: Fri Jan 22, 2016 4:58 am

Re: httpd process monitoring on remote linux server

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: httpd process monitoring on remote linux server

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Beena_Jogin
Posts: 54
Joined: Fri Jan 22, 2016 4:58 am

Re: httpd process monitoring on remote linux server

Post 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
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: httpd process monitoring on remote linux server

Post 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
Nagios XI 5.8.1
https://outsideit.net
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: httpd process monitoring on remote linux server

Post 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.
Former Nagios Employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: httpd process monitoring on remote linux server

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked