Computing.Net > Forums > Solaris > Script to Monitor some processes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Script to Monitor some processes

Reply to Message Icon

Name: new2prog
Date: December 23, 2005 at 11:00:38 Pacific
OS: Solaris
CPU/Ram: 4
Comment:

Hi,

I am looking for a script to monitor few processes on Solaris box. This script should send me a email once if any critical daemons go down.
Also the out of the script should tell me how many instances of each process is running ( out out should look some what like this. )
Process Name Number
abc 1
xyz 2

Thanks in advance..




Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: December 24, 2005 at 00:01:15 Pacific
Reply:

Below is just a suggestion .

1) Get a baseline of the processes that are
running on your system. Pipe the output to
a file, call it baseline.txt or something
eg ps -eo fname | uniq > baseline.txt
Ensure that the system only runs the
necessary applications that you want for
normal operations
2) Write a script to
a) get current processes of the system, ie
can use the same command as 1a)
b) Iterate the results of 2a) using loops
as well as using the "grep" command to
search whether your process is "down"
eg for process in `ps -eo fname|uniq`
do
grep $process baseline.txt
if return result is 1 (not found)
then process_alerts
done



0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: Script to Monitor some processes

script to monitor file size www.computing.net/answers/solaris/script-to-monitor-file-size-/4817.html

Script to dectect vi /etc/host file www.computing.net/answers/solaris/script-to-dectect-vi-etchost-file/2853.html

checked a script to count the numbe www.computing.net/answers/solaris/checked-a-script-to-count-the-numbe/3894.html