CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [FishMonger] Executing script from cron.d: Edit Log



dzordzyk
Novice

Mar 13, 2010, 4:30 PM


Views: 8217
Re: [FishMonger] Executing script from cron.d

When i run script from console:


Code
sudo perl check_service


script works fine - so, my service is down and i get sms and mail.

When scripts run from cron.d, i didn't get sms and mail - service is down too.
From cron.d script is running, but in script, it didn't get into "if":


Code
23 my $ps_output = `ps ax | grep "$service" | grep -v $0 | grep -v grep`; 
24 if ($ps_output eq "") {
25 print "$service IS NOT WORKING\n";
26 Common::alert_sms($service);
27 Common::alert_mail("$service\@$Common::hostname IS NOT WORKING", "$service\@$Common::hostname IS NOT WORKING");
30 }
31 else {
32 print "$service is working\n";
33 }



(This post was edited by dzordzyk on Mar 13, 2010, 4:31 PM)


Edit Log:
Post edited by dzordzyk (Novice) on Mar 13, 2010, 4:31 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives