Any script to monitor % of PROCESSES init value being utilized.
Hello Admin/Community,
Looking for a script to monitor % of PROCESSES value being currently utilized, and trigger notification if usages exceeds lets say 80% of value set for PROCESSES init parameter …
Thanks
Below script will trigger notification if process count increase values of 50. ( You can change according to your requirement)
step 1 :
create a sql script as
cat /home/oracle/monitor/proc_count.sql
set feed off;
select count(*) from gv$process;
step 2 :
create a shell script as – >
cat /home/oracle/monitor/proc_count.sh
export ORACLE_HOME=/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ORCL
export PATH=$ORACLE_HOME/bin:$PATH
set -o vi
pro_count=`sqlplus -s ORDBA/ORDBA << EOF
set head off
set feed off
spool /home/oracle/monitor/count.log
@/home/oracle/monitor/proc_count.sql
spool off
exit
EOF`
if [ $pro_count -ge 50 ];
then
mailx -s “TOTAL PROCESS COUNT CAN REACH MAX PROCESS () ” support@dbaclass.com < /home/oracle/monitor/count.log
fi
step 3 :
configure the shell script in cronjtab:
0,10,20,30,40,50 * * * * /home/oracle/monitor/proc_count.sh > /tmp/proccount_log.log
Regards
Admin