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.
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

Yes, the process is running

oracle 4604 1 0 02:50:20 ? 0:02 ora_pmon_sinamp
nagios 5276 5255 0 09:16:50 pts/1 0:00 grep ora_pmon_sinamp
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 »

Just to clarify...

When you run:

Code: Select all

# ps -ef | grep ora_pmon_sinamp
it shows you that the process is running, right?

But when you run:

Code: Select all

# ./check_procs -C ora_pmon_sinamp
it shows you:
0 processes with command name 'ora_pmon_sinamp'
Is this correct?
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 »

When I executed:

./check_procs -C ora_pmon_sinamp

The output is:

PROCS OK: 0 processes with command name 'ora_pmon_sinamp'

and the process is ruuning
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 »

What happens, when you run a check against other processes, for example:

Code: Select all

# ./check_procs -C nagios
or

Code: Select all

# ./check_procs -C httpd
It is very strange why this process is "not seen", even though it is running... Does "ps" see it? Try again:

Code: Select all

# ps -ef | grep ora_pmon_sinamp
and post the output.
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 »

This is the output:

$ ./check_procs -C httpd
PROCS OK: 0 processes with command name 'httpd'

$ ps -ef|grep httpd
nagios 19765 5255 0 15:04:11 pts/1 0:00 grep httpd

$ ./check_procs -C nagios
PROCS OK: 0 processes with command name 'nagios'

$ ps -ef|grep nagios
nagios 19907 5255 0 15:06:03 pts/1 0:00 ps -ef
nagios 5255 5253 0 Jan 23 pts/1 0:00 -sh
nagios 19908 5255 0 15:06:03 pts/1 0:00 grep nagios
nagios 5253 5250 0 Jan 23 ? 0:00 sshd: nagios@pts/1
root 5250 1585 0 Jan 23 ? 0:01 sshd: nagios [priv]

$ ps -ef | grep ora_pmon_sinamp
nagios 19791 5255 1 15:04:48 pts/1 0:00 grep ora_pmon_sinamp
oracle 6127 1 0 06:11:39 ? 0:03 ora_pmon_sinamp

$ ./check_procs -C ora_pmon_sinamp
PROCS OK: 0 processes with command name 'ora_pmon_sinamp'
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 »

You can create a file named /etc/sysconfig/nagios
and add the line

Code: Select all

export UNIX95=1
This should add the environment before the plugin runs.

Ref:
http://tracker.nagios.org/view.php?id=24
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

Hi,

Thank you for the information, the path /etc/sysconfig/nagios, not exist in my machine that I want monitoring:


nagios@sinampro$ ls -ltr sys*
lr--r--r-- 1 bin bin 19 Jul 18 2008 syslog.pid -> /var/run/syslog.pid
lr-xr-xr-x 1 bin bin 17 Jul 18 2008 syslogd -> /usr/sbin/syslogd
lr-xr-xr-x 1 bin sys 16 Jul 18 2008 sysdef -> /usr/sbin/sysdef
-r--r--r-- 1 bin bin 249 Jul 3 2009 syslog.conf

The machine, where I want monitoring process is HP-UX sinampro B.11.31 U ia64 1219818353 unlimited-user license

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 »

I forgot we were running this command via nrpe.

On the remote machine lets do the following

Code: Select all

su nagios
export UNIX95=1
su - 
This should set the UNIX95=1 env for the nagios user which should be what the nrpe on the remote machine runs as.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
msanbrug
Posts: 58
Joined: Fri Nov 04, 2011 7:40 am

Re: QUESTION: check_http and multiple instances of apache

Post by msanbrug »

Hello,


su nagios
export UNIX95=1
su -

I executed env, and variable appear, but if I executed:

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

This failed.
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:Hello,


su nagios
export UNIX95=1
su -

I executed env, and variable appear, but if I executed:

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

This failed.
Are you running this from root, or from the nagios user?
try

Code: Select all

su nagios -c '/usr/local/nagios/libexec/check_procs -C ora_pmon_sinamp'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked