We introduced sending an email when Fencing fails/succeeds in
general some time ago, send now also an email if a HW fence
fails
---
 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 ca13f2f..c4d147c 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;
@@ -204,7 +205,6 @@ EOF
     $haenv->sendmail($mail_subject, $mail_text);
 };
 
-
 # start fencing
 sub fence_node {
     my ($self, $node) = @_;
@@ -230,8 +230,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.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to