jmneedhamco has asked for the wisdom of the Perl Monks concerning the following question:
I am working on a script to automate some process checking and basically want the script to check processes and then if one is not running, start it.
There are several instances of Apache for example that are running for various groups in our company. So I envision a for/each loop. This loop would check each process in turn and then if the ps command returns FAILURE, then it would launch that start command associated with that process.
The question here is: Would the best approach be a couple of arrays with the cmds in them? The way to look at each process on this box is the same save the item we are grepping for.
Help to do this in most efficient way is appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Efficient Automation
by QM (Parson) on Apr 27, 2015 at 15:42 UTC | |
|
Re: Efficient Automation
by karlgoethebier (Abbot) on Apr 27, 2015 at 18:32 UTC | |
|
Re: Efficient Automation
by MidLifeXis (Monsignor) on Apr 27, 2015 at 15:45 UTC | |
|
Re: Efficient Automation
by Perlbotics (Archbishop) on Apr 27, 2015 at 19:59 UTC |