HI
Could you please provide the check_ncpa.py command you are using with check_procs ?
Thank you
Issue Monitoring Oracle Processes with 'check_procs'
-
- Posts: 50
- Joined: Thu Sep 23, 2021 12:26 pm
Re: Issue Monitoring Oracle Processes with 'check_procs'
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).
Thank you,
-Frank
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.
Re: Issue Monitoring Oracle Processes with 'check_procs'
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:
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
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