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
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
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
Summary: Hi All, Can anyone please help with the following, I'm trying to write a script(bash) that will: 1. constantly run in the background and monitor the size of a particular file. 2. When this file reach...
Summary: I'm trying to get the script to prevent people update /etc/hosts file simultaneously. Later on, if the script work, it will be put in system cron, but I have no idea how to get the script to detect v...
Summary: checked a script to count the number of parameters (arguments ) to the script. I know that it is just one word ($#).But this is using for,while ,and until. ****************************************** ...