Commit 2908b4eb authored by Leigh Stoller's avatar Leigh Stoller

Change status to distinguish between unreachable (does not ping) and

the CM offline.
parent b9f54019
......@@ -542,6 +542,16 @@ sub ProcessResults($)
# Mark that we have sent email
$status{$urn}->{'status'}->{'status'} = "dead";
if ($aggregate->status() eq "up") {
if ($impotent) {
print STDERR "Would mark $nickname as offline\n";
}
else {
$aggregate->status("offline");
$aggregate->StatusEvent("offline");
}
}
}
elsif ($dailymail &&
$status{$urn}->{'status'}->{'status'} eq "dead") {
......@@ -561,6 +571,15 @@ sub ProcessResults($)
}
$status{$urn}->{'status'}->{'status'} = "up";
$status{$urn}->{'status'}->{'stamp'} = undef;
if ($aggregate->status() eq "offline") {
if ($impotent) {
print STDERR "Would mark $nickname as up\n";
}
else {
$aggregate->status("up");
$aggregate->StatusEvent("up");
}
}
}
}
}
......@@ -823,7 +842,7 @@ sub NotifySlack($)
my ($message) = @_;
return
if (0 && $debug);
if ($impotent);
if (open(PIPE, "| $CURL -s -X POST -H ".
"'Content-type: application/json' --data \@- $SLACKURL")){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment