From a0dc314bb271ac49e8555178b9af619380e7978f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germain=20Carr=C3=A9?= Date: Tue, 8 Aug 2023 21:18:50 +0200 Subject: [PATCH] Updating needrestart probe --- VERSION | 2 +- probes/examples/needrestart | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index e266056..03289a3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.73.28 +0.73.29 diff --git a/probes/examples/needrestart b/probes/examples/needrestart index 7141306..4466495 100755 --- a/probes/examples/needrestart +++ b/probes/examples/needrestart @@ -31,11 +31,18 @@ unless ( -x $needrestart ) my $outNeedRestart = `$needrestart -k -p -l`; my $returnCode = $?; +my @lines = split("\n", $outNeedRestart); +detail->{'output'} = $lines[0]; +detail->{'returncode'} = $returnCode; if($returnCode == 512) { status 200; message "Restart needed"; } +elsif($returnCode == 256) +{ + message "Restart not required"; +} elsif($returnCode) { status 500; @@ -47,7 +54,4 @@ else message "Restart not needed"; } -my @lines = split("\n", $outNeedRestart); -detail->{'output'} = $lines[0]; - output 0;