yes, I'm needing this for my "mon" and "heartbeat" integration. I put this under /etc/ha.d/mon/mon.d directory and named it as squid.monitor script for monitoring squid...(since I'm running a squid clusterring)....once squid is not active, mon will trigger/kill the heartbeat to stop ...then fail-over occured to server B. I already modify your script and the one given by Mr. Milver Nasay and it works successfully as I have expected..........many many thanks....he he he finally it works...
-----Original Message----- From: Emanuel G Calso [mailto:[EMAIL PROTECTED] Sent: Thursday, May 06, 2004 12:09 AM To: [EMAIL PROTECTED]; Philippine Linux Users Group Mailing List Subject: Re: [plug] perl script for squid On Wednesday 2004 May 05 23:43, Ed wrote: > Is there a simple perl sript that can monitor squid process, I can't find > one on google pls help....Im not too familiar with perl scripting....by the > way here's the condition. > 1.) looking for the squid process (like "ps aux | grep squid" commnand in > unix) > 2.) If there is squid process, nothing to be done then exit. > 3.) If there's no squid process, simply start squid service and exit. No need for Perl for this one, here's the bash script, it's not yet efficient, but this is what i thought of first: ---- #!/bin/sh if [ ! "`ps aux | grep squid`" ]; do <COMMAND TO START SQUID> done ---- And that's it! If you insist on making making a Perl script: ---- #!/usr/bin/perl unless ("`ps aux | grep squid`") { `<COMMAND TO START SQUID>` } ---- hehe. HTH. Will you be needing this to run with something? just say so... if not, that should work. -- eman calso http://www.bloodpet.tk/ Go placidly amid the noise and waste, and remember what value there may be in owning a piece thereof. -- National Lampoon, "Deteriorata" -- Philippine Linux Users' Group (PLUG) Mailing List [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
