1834406 Members
1647 Online
110067 Solutions
New Discussion

Simple script

 
SOLVED
Go to solution
H_16
Trusted Contributor

Simple script


Can someone help !!

I need a shell script {HP-UX) to monitor
my oracle PMON processes...I have three databases running so I obviously have three PMON processes running..I want a script that if one or more processes are not there it sends a error message using opcmsg (OVO)

any ideas
3 REPLIES 3
Mark Grant
Honored Contributor
Solution

Re: Simple script

The simple way would be

[[ `ps -ef | grep -v grep | grep ora_pmon | wc -l` -eq 3 ]] || /opt/OV/bin/OpC/opcmsg application=Monitor object=OS msg_text="at least on pmon is missing" msg_grp= severity=critical node=

However, this might occassionally alert when there is no problem at all as other processes might make grep see ora_pmon. You could adapt it to be cleverer though.
Never preceed any demonstration with anything more predictive than "watch this"
H_16
Trusted Contributor

Re: Simple script


Thanks for the quick response..
Nicolas Dumeige
Esteemed Contributor

Re: Simple script

Hello,

It might be valuable to which instance is down - for instance if you want the monitoring team to re-start it - then you might want to loop on your oratab file.

My 0,02 cents

Nicolas
All different, all Unix