QUESTION: check_http and multiple instances of apache

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jrmartin
Posts: 46
Joined: Mon Aug 08, 2011 6:55 pm

QUESTION: check_http and multiple instances of apache

Post by jrmartin »

Greetings,
I have a server with several virtual interfaces. Each interface is tied to an apache instance. If I want to monitor them with nagios, would I have to create a check_http command for each individual interface? Also, this is being performed by check_nrpe
i.e.
command[check_http].....
command[check_http_vnic1]...
command[check_http_vnic2]...
etc...
I am only interested that apache is running and responding but don't want to do a website check as the front end is load balanced and could either go to two different servers. So I need to ensure that I am checking on each server that the service is running.

Any advice on the best way to accomplish this is appreciated. Thanks in advance.,

Jeff
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: QUESTION: check_http and multiple instances of apache

Post by nscott »

You'll have to use NRPE for sure with check_procs and use the -C flag which will cause check_procs to look for processes started using the EXACT -C arguments, so to test to see if Nagios was started with the config in /etc/nagios.cfg rather than /usr/local/nagios/etc/nagios.cfg we would enter

check_procs -C 'nagios -c /etc/nagios.cfg'
Nicholas Scott
Former Nagios employee
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

I have to monitoring process ora_pmon_sinamp. The process is running in the machine (HPUX):

oracle 28067 1 0 02:48:37 ? 0:03 ora_pmon_sinamp


but, when I executed command:

/opt/iexpress/nagios/libexec/check_procs -C 'ora_pmon_sinamp'
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

How I can monitoring this process?

Regards.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: QUESTION: check_http and multiple instances of apache

Post by scottwilkerson »

msanbrug wrote:I have to monitoring process ora_pmon_sinamp. The process is running in the machine (HPUX):

oracle 28067 1 0 02:48:37 ? 0:03 ora_pmon_sinamp


but, when I executed command:

/opt/iexpress/nagios/libexec/check_procs -C 'ora_pmon_sinamp'
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

How I can monitoring this process?

Regards.
Are you executing this command from the same machine as the process in running?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: QUESTION: check_http and multiple instances of apache

Post by lmiltchev »

Type in terminal (on the target machine):

Code: Select all

# ps -ef | grep ora_pmon_sinamp
to make sure the process is running.

Next, edit your "check_local_procs" command definition in the "commands.cfg" file:

Code: Select all

# vi /usr/local/nagios/etc/commands.cfg
Change it from: "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$" to "$USER1$/check_procs -w $ARG1$ -c $ARG2$ -a $ARG3$"

Check if you can monitor this process locally:

Code: Select all

# /usr/local/nagios/libexec/check_procs -a ora_pmon_sinamp
If you succeed, you can type in terminal (on your Nagios server):

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H <your_target_machine_IP_address> -t 30 -c check_procs -a '-a ora_pmon_sinamp'
You can also add arguments for warning and critical, for example:

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H <your_target_machine_IP_address> -t 30 -c check_procs -a '-w 5 -c 10 -a ora_pmon_sinamp'
Once you make it work from the command line, you can deal with the web interface. This document may help you with this:

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

I probed this, but appear process is down. I see that in HPUX, not correctly ps:

When I do ps -el:

1401 S 30208 1023 1 0 154 20 e0040100009c4380 25741 e00000019b2292e8 ? 0:02 oracle

If i do export UNIX95=1

1401 S 30208 11276 1 0 154 20 e000000198924c80 25689 e000000144cee080 ? 00:00:00 ora_pmon_sinamp

but if i do:

command[check_procs_pmon_sinamp]=export UNIX95=1;/opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'


If I defined in nrpe.cfg:
export UNIX95=1
command[check_procs_pmon_sinamp]=/opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp

Appear this:

PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

Any idea?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: QUESTION: check_http and multiple instances of apache

Post by lmiltchev »

Try this command:

Code: Select all

command[check_procs_pmon_sinamp]= UNIX95= /opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
or

Code: Select all

command[check_procs_pmon_sinamp]= UNIX95=1 /opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
Let me know if this works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

I probed this but is not correctly:

/opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

UNIX95=1 /opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

Any idea?

Regards.
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

Excuse me, I was wrong when he wrote.I probed two options:

UNIX95= /opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp
UNIX95=1 /opt/iexpress/nagios/libexec/check_procs -C ora_pmon_sinamp

And the output:

PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

I add too in nrpe.cfg, but the output is the same.


Thanks,
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: QUESTION: check_http and multiple instances of apache

Post by lmiltchev »

Is this process running? Can you run a test against a different process, that is running for sure?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked