Operating System - HP-UX
1836525 Members
3168 Online
110101 Solutions
New Discussion

Managing working process in HP-UX

 
Ahmed M. AlShafiy
Regular Advisor

Managing working process in HP-UX

how can i manag the oracle database and the oracle application so i can get e-mails to root or oracle user or applmgr user about the shutting down for the database and the application
4 REPLIES 4
Victor Fridyev
Honored Contributor

Re: Managing working process in HP-UX

I don't know about standard tools for this, but you can do something like this:
LOCK=/tmp/ora_lock
SID={your_oracle_sid}
if [ $(ps -fuoracle|grep [ps]mon_$sid|wc -l) -ne 2 ]; then
if [ -f $LOCK ]; then
exit
else
echo "ORACLE_SID $sid: ORACLE not available" |mailx -s "ORACLE_SID $sid: ORACLE not available" mailaddress
touch $LOCK
fi
else
rm $LOCK 2>/dev/null
fi
You can run this script from crontab each minute.

A similar procedure you can use for monitoring of your application


Entities are not to be multiplied beyond necessity - RTFM
Lars Ebeling
Frequent Advisor

Re: Managing working process in HP-UX

Hi,
I used to use BigBrother to monitor Oracle-databases.
There is a new product now GPL-licensed. This product is called Hobbit and can be found at http://sourceforge.net/projects/hobbitmon/

With a plugin you also could monitor tablespaces. Any further questions could be asked in the hobbit userlist.

Regards
Lars
Ahmed M. AlShafiy
Regular Advisor

Re: Managing working process in HP-UX

sorry but i'm new in HP-UX


what i have to do to run the script above?
do i have to write in a file ? what is the exc. of the file ?

Victor Fridyev
Honored Contributor

Re: Managing working process in HP-UX

OK,

If you want to monitor ORACLE DB, create a file, e.g /usr/local/bin/oramon.sh and insert into in it the following:

#!/usr/bin/sh
LOCK=/tmp/ora_lock
sid={your_oracle_sid}
if [ $(ps -fuoracle|grep [ps]mon_$sid|wc -l) -ne 2 ]; then
if [ -f $LOCK ]; then
exit
else
echo "ORACLE_SID $sid: ORACLE not available" |mailx -s "ORACLE_SID $sid: ORACLE not available" {mailaddress}
touch $LOCK
fi
else
rm $LOCK 2>/dev/null
fi
#END OF THE SCRIPT


You can run this script from crontab each minute as
Run as root:
crontab -e
Edit the file:
* * * * * /usr/local/bin/oramon.sh


Don't forget to make the script executable:
chmod +x /usr/local/bin/oramon.sh


HTH
Entities are not to be multiplied beyond necessity - RTFM