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

Posted on 2007-11-17
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,
Question by:casemanager
  • 3
  • 2
LVL 40

Expert Comment

ID: 20304015

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



Author Comment

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??

LVL 40

Accepted Solution

omarfarid earned 125 total points
ID: 20306302


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
      /usr/bin/date >> /path/to/pmon.log
      echo "running ...." >> /path/to/pmon.log
     /usr/bin/mail -s "pmon not running" username < /dev/null

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)


crontab mycrontab
crontab -l

Author Comment

ID: 20306792
Thanks...I tried the solution and is seems to fulfill the purpose for now..

Author Closing Comment

ID: 31409719
Thanks Omarfarid for the excellent answer

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

929 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now