diff --git a/xCAT-server/lib/xcat/monitoring/pcpmon.pm b/xCAT-server/lib/xcat/monitoring/pcpmon.pm index 3b7731590..0af1be3ed 100644 --- a/xCAT-server/lib/xcat/monitoring/pcpmon.pm +++ b/xCAT-server/lib/xcat/monitoring/pcpmon.pm @@ -57,8 +57,11 @@ sub start my $value=5; #default my %settings=xCAT_monitoring::monitorctrl->getPluginSettings("pcpmon"); - my $reading=$settings{'ping-interval'}; - if ($reading>0) { $value=$reading;} + my $reading; + if (exists($settings{'ping-interval'})) { + $reading=$settings{'ping-interval'};; + if ($reading>0) { $value=$reading;} + } #create the cron job, it will run the command every 5 minutes(default and can be changed). my $newentry; diff --git a/xCAT-server/lib/xcat/monitoring/xcatmon.pm b/xCAT-server/lib/xcat/monitoring/xcatmon.pm index 60ed67808..9f1f30dfe 100644 --- a/xCAT-server/lib/xcat/monitoring/xcatmon.pm +++ b/xCAT-server/lib/xcat/monitoring/xcatmon.pm @@ -131,8 +131,11 @@ sub startNodeStatusMon #foreach (keys(%settings)) { # print "key=$_, value=$settings{$_}\n"; #} - my $reading=$settings{'ping-interval'}; - if ($reading>0) { $value=$reading;} + my $reading; + if (exists($settings{'ping-interval'})) { + $reading=$settings{'ping-interval'}; + if ($reading>0) { $value=$reading;} + } #create the cron job, it will run the command every 3 minutes. my $newentry;