Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2007-11-17
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
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 how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

722 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