From cf2f5fc7b2ea51b6bfab5cfba611f2465c66f323 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Thu, 30 Jan 2025 11:29:44 +0100 Subject: [PATCH] node control: make nicer error messages --- .../node-control/lib/Thruk/NodeControl/Utils.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/plugins-available/node-control/lib/Thruk/NodeControl/Utils.pm b/plugins/plugins-available/node-control/lib/Thruk/NodeControl/Utils.pm index f351a65a8..a96ec03c2 100644 --- a/plugins/plugins-available/node-control/lib/Thruk/NodeControl/Utils.pm +++ b/plugins/plugins-available/node-control/lib/Thruk/NodeControl/Utils.pm @@ -1442,6 +1442,18 @@ sub _die_connection_error { die($http_err); } + if(($http_err//'') =~ m/\Qinternal error: admin privileges required\E/mx) { + $http_err = "admin privileges required\n".$http_err; + die($http_err."\nssh failed: ".$ssh_err) if $ssh_err; + die($http_err); + } + + if(($http_err//'') =~ m/\Q403: Forbidden\E/mx) { + $http_err = "403: Forbidden\n".$http_err; + die($http_err."\nssh failed: ".$ssh_err) if $ssh_err; + die($http_err); + } + die("http(s) and ssh connection failed\nhttp(s):\n".$http_err."\n\nssh:\n".$ssh_err) if($http_err && $ssh_err); die("http(s) connection failed\n".$http_err) if $http_err; die("ssh connection failed\n".$ssh_err) if $ssh_err;