Page 2 of 4
Re: QUESTION: check_http and multiple instances of apache
Posted: Mon Jan 23, 2012 3:17 am
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
Re: QUESTION: check_http and multiple instances of apache
Posted: Mon Jan 23, 2012 11:32 am
by lmiltchev
Just to clarify...
When you run:
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?
Re: QUESTION: check_http and multiple instances of apache
Posted: Tue Jan 24, 2012 8:59 am
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
Re: QUESTION: check_http and multiple instances of apache
Posted: Tue Jan 24, 2012 3:55 pm
by lmiltchev
What happens, when you run a check against other processes, for example:
or
It is very strange why this process is "not seen", even though it is running... Does "ps" see it? Try again:
and post the output.
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Jan 25, 2012 9:06 am
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'
Re: QUESTION: check_http and multiple instances of apache
Posted: Wed Jan 25, 2012 9:50 am
by scottwilkerson
You can create a file named /etc/sysconfig/nagios
and add the line
This should add the environment before the plugin runs.
Ref:
http://tracker.nagios.org/view.php?id=24
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 26, 2012 6:18 am
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
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 26, 2012 12:06 pm
by scottwilkerson
I forgot we were running this command via nrpe.
On the remote machine lets do the following
This should set the UNIX95=1 env for the nagios user which should be what the nrpe on the remote machine runs as.
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 26, 2012 12:56 pm
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.
Re: QUESTION: check_http and multiple instances of apache
Posted: Thu Jan 26, 2012 2:16 pm
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'