Issue Monitoring Oracle Processes with 'check_procs'

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Issue Monitoring Oracle Processes with 'check_procs'

Post by gsmith »

HI

Could you please provide the check_ncpa.py command you are using with check_procs ?

Thank you
lazzarinof
Posts: 50
Joined: Thu Sep 23, 2021 12:26 pm

Re: Issue Monitoring Oracle Processes with 'check_procs'

Post by lazzarinof »

Good morning,

Of course! First, I tried to use the GUI (because no point reinventing the wheel if it's built in), but without success. Then I've been working with the below (with the correct IP and Token, but I scrubbed those).

Code: Select all

$ /usr/local/nagios/libexec/check_ncpa.py -H x.x.x.x -t 'Token' -P 5693 -M 'processes' -q 'name=ora_pmon_cetsdevcdb' -w '1:' -c '1:'

Thank you,
-Frank
You do not have the required permissions to view the files attached to this post.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Issue Monitoring Oracle Processes with 'check_procs'

Post by gsmith »

Hi

When you use check_ncpa.py the way you have shown it is counting the number of oracle processes you have running (in your case 473).

So on the remote machine it is running something like:
ps -ef | grep oracle | wc -l

What you would need to do is to have a script (or multiple scripts) on the remote machine that do something like:

Code: Select all

#!/bin/bash
output=`ps -ef | grep xfs | grep $1 |  wc -l`
re='^[0-9]+$'
if ! [[ $output =~ $re ]] ; then
   echo "error: Not a number"; exit 1
fi
echo "Number of Oracle $1 processes is $output"
exit 0

And then from the XI server run:
./check_ncpa.py -H 192.168.23.86 -t 'mytoken' -P 5693 -M 'plugins/myscript.sh' -a 'ora_pmon_cetsdevcdb' -w '10' -c '15'

The script gets all the oracle processes and then only counts the ones that have the argument following the -a option,
so in the above check_ncpa.py command it would count all the processes with "oracle" and "ora_pmon_cetsdevcdb" in
the output of the ps command.

Thanks
Locked