[pve-devel] [PATCH ha-manager v7 3/4] send also email on hardware fence failure
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Aug 5 14:43:19 CEST 2016
We introduced sending an email when Fencing fails/succeeds in
general some time ago, send now also an email if a HW fence
fails
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
src/PVE/HA/NodeStatus.pm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/PVE/HA/NodeStatus.pm b/src/PVE/HA/NodeStatus.pm
index d077c7b..02b69c6 100644
--- a/src/PVE/HA/NodeStatus.pm
+++ b/src/PVE/HA/NodeStatus.pm
@@ -2,6 +2,7 @@ package PVE::HA::NodeStatus;
use strict;
use warnings;
+
use PVE::HA::Fence;
use JSON;
@@ -205,7 +206,6 @@ EOF
$haenv->sendmail($mail_subject, $mail_text);
};
-
# start fencing
sub fence_node {
my ($self, $node) = @_;
@@ -231,8 +231,9 @@ sub fence_node {
# bad fence.cfg or no devices and only hardware fencing configured
if ($hw_fence_success < 0 && $fencing_mode eq 'hardware') {
- $haenv->log('err', "Fencing of node '$node' failed and needs " .
- "manual intervention!");
+ my $msg = "Fencing of node '$node' failed and needs manual intervention!";
+ $haenv->log('err', $msg);
+ &$send_fence_state_email($self, 'FAILED', $msg, $node);
return 0;
}
--
2.1.4
More information about the pve-devel
mailing list