From ad71dd41b0959fcad4627c36003b0b423b7588fe Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 21 Feb 2008 18:36:26 +0000 Subject: [PATCH] minor fix for xcatmon git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@540 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm | 11 ++++++++++- 1 file changed, 10 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 347f649a3..2935db6b5 100644 --- a/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm +++ b/xCAT-server-2.0/lib/xcat/monitoring/xcatmon.pm @@ -96,7 +96,16 @@ sub supportNodeStatusMon { #-------------------------------------------------------------------------------- sub startNodeStatusMon { #print "xcatmon.startNodeStatusMon\n"; - my $newentry="*/3 * * * * XCATROOT=$::XCATROOT $::XCATROOT/sbin/xcatnodemon"; + + #run the command first to update the status, + my $cmd="$::XCATROOT/sbin/xcatnodemon"; + $output=`$cmd 2>&1`; + if ($?) { + print "xcatmon: $output\n"; + } + + #create the cron job, it will run the command every 3 minutes. + my $newentry="*/3 * * * * XCATROOT=$::XCATROOT $cmd"; my ($code, $msg)=xCAT::Utils::add_cron_job($newentry); if ($code==0) { return (0, "started"); } else { return ($code, $msg); }