Author: fapeeler
Date: Thu Aug 27 15:36:18 2009
New Revision: 808460
URL: http://svn.apache.org/viewvc?rev=808460&view=rev
Log:
VCL-169
Added restore option to reset management node to available state.
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm
Modified: incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm?rev=808460&r1=808459&r2=808460&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/healthcheck.pm Thu Aug 27
15:36:18 2009
@@ -152,9 +152,10 @@
notify($ERRORS{'OK'}, $LOG, "in processing routine");
$info->{"globalmsg"}->{"body"} = "Summary of VCL node monitoring
system:\n\n";
+ my $mn_hostname = $info->{managementnode}->{hostname};
+
if($powerdownstage =~ /^(available|all)$/){
- my $mn_hostname = $info->{managementnode}->{hostname};
- notify($ERRORS{'OK'}, $LOG, "ALERT: powerdown stage
triggered,placing MN $mn_hostname in maintenance");
+ notify($ERRORS{'CRITICAL'}, $LOG, "ALERT: powerdown stage
triggered,placing MN $mn_hostname in maintenance");
if (set_managementnode_state($info->{managementnode},
"maintenance")) {
notify($ERRORS{'OK'}, $LOG, "Successfully set
$mn_hostname into maintenance");
}
@@ -162,6 +163,18 @@
notify($ERRORS{'WARNING'}, $LOG, "Failed to set
$mn_hostname into maintenance");
}
}
+ elsif($powerdownstage =~ /^restore/){
+ notify($ERRORS{'CRITICAL'}, $LOG, "ALERT: Environment OK:
restoring state of MN $mn_hostname in available");
+ if (set_managementnode_state($info->{managementnode},
"available")) {
+ notify($ERRORS{'OK'}, $LOG, "Successfully set
$mn_hostname into available");
+ }
+ else{
+ notify($ERRORS{'WARNING'}, $LOG, "Failed to set
$mn_hostname into available");
+ }
+ }
+ else{
+ #proceed standard checks
+ }
foreach my $cid (keys %{$info->{computertable}}) {
#set some local variables