Solved

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

Posted on 2007-11-17
5
705 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

821 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