Solved

How do I check the downtime of a process in sun solaris?

Posted on 2007-11-17
5
704 Views
Last Modified: 2013-12-27
Greetings experts,

I have a sun solaris server (version 9) and I want to check the downtime of a process. For example if my oracle process (pmon) goes down during the night , I can come in the next morning and check the time duration during which the process was down.

Please help.

Thanks and regards,
casemanager
0
Comment
Question by:casemanager
  • 3
  • 2
5 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 20304015
Hi,

You may look in to the Oracle logs to see when the process stopped (last log).

You may also look in to the system logs like

/var/log/syslog
/var/adm/messages

0
 
LVL 1

Author Comment

by:casemanager
ID: 20306139
Thanks for replying Omar. I got the information I was looking for in the logs generated in /var/adm/messages. Is there any way in which I can automate this process and get to know this information without checking the logs. What I am trying to say is -Oracle process goes down every night for about 3 hours. Is there any way in which the server can send me a report via email with the information as  to when the process was unavaliable and the time when it was back up.

I am thinking that this requires modification of the syslog parameters --all I want to know is how to do it??

Thanks.
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 125 total points
ID: 20306302
Hi,

Well,

You may have a crontab job that run say every 5 min. The job (e.g. script) can check for the process (in the server's running processes or logs), and if found not running may send you email.

e.g. you may create script called monitormypmon (here I will assume that the process just die and not running), and contains

count=`/usr/bin/ps -ef | /usr/bin/grep -v grep | /usr/bin/grep pmon | wc -l`
if test $count -gt 0
then
      /usr/bin/date >> /path/to/pmon.log
      echo "running ...." >> /path/to/pmon.log
else
     /usr/bin/mail -s "pmon not running" username < /dev/null
fi

Make this script executable:

chmod +x monitormypmon

To create crontab job, run:

crontab -l > mycrontab

edit mycrontab (e.g. vi mycrontab) and add line similar to:

0,10,20,30,40,50 * * * * /path/to/monitormypmon


The above schedule will run the script every 10 min (for more info please use man crontab)

run:

crontab mycrontab
crontab -l
0
 
LVL 1

Author Comment

by:casemanager
ID: 20306792
Thanks...I tried the solution and is seems to fulfill the purpose for now..
0
 
LVL 1

Author Closing Comment

by:casemanager
ID: 31409719
Thanks Omarfarid for the excellent answer
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question