Page 1 of 4
QUESTION: check_http and multiple instances of apache
Posted: Mon Aug 29, 2011 6:57 pm
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
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Aug 31, 2011 1:01 pm
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'
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Jan 18, 2012 3:34 am
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.
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Jan 18, 2012 11:07 am
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?
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Jan 18, 2012 11:23 am
by lmiltchev
Type in terminal (on the target machine):
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
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 19, 2012 3:47 am
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?
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 19, 2012 12:44 pm
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.
Re: QUESTION: check_http and multiple instances of apache
Posted: Fri Jan 20, 2012 3:10 am
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.
Re: QUESTION: check_http and multiple instances of apache
Posted: Fri Jan 20, 2012 3:15 am
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,
Re: QUESTION: check_http and multiple instances of apache
Posted: Fri Jan 20, 2012 2:55 pm
by lmiltchev
Is this process running? Can you run a test against a different process, that is running for sure?