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); }