From 999c1993863f5e7b3cbf9aa337a05e0e26dac8cd Mon Sep 17 00:00:00 2001 From: linggao Date: Wed, 19 Mar 2008 15:20:19 +0000 Subject: [PATCH] made changes in xcatmon.pm because the cron job syntax are different between linux and aix. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@834 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../lib/xcat/monitoring/xcatmon.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm b/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm index 70705fbd0..639ce8586 100644 --- a/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm +++ b/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm @@ -115,7 +115,24 @@ sub startNodeStatusMon { if ($reading>0) { $value=$reading;} #create the cron job, it will run the command every 3 minutes. - my $newentry="*/$value * * * * XCATROOT=$::XCATROOT PATH=$ENV{'PATH'} XCATCFG='$ENV{'XCATCFG'}' $cmd"; + my $newentry; + if (xCAT::Utils->isAIX()) { + #AIX does not support */value format, have to list them all. + my $minutes; + if ($value==1) { $minutes='*';} + elsif ($value<=30) { + my @temp_a=(0..59); + foreach (@temp_a) { + if (($_ % $value) == 0) { $minutes .= "$_,";} + } + chop($minutes); + } else { + $minutes="0"; + } + $newentry="$minutes * * * * XCATROOT=$::XCATROOT PATH=$ENV{'PATH'} XCATCFG='$ENV{'XCATCFG'}' $cmd"; + } else { + $newentry="*/$value * * * * XCATROOT=$::XCATROOT PATH=$ENV{'PATH'} XCATCFG='$ENV{'XCATCFG'}' $cmd"; + } my ($code, $msg)=xCAT::Utils::add_cron_job($newentry); if ($code==0) { return (0, "started"); } else { return ($code, $msg); }