From 961d9da5e5de6aa36d6dbdcec1abb9e747c008ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20S=C3=89RIE?= Date: Tue, 10 Jul 2018 11:32:18 +0200 Subject: [PATCH] Backport fix from Daniel Jakots Original commit: The code was taken from check_http_many which apparently deals only with return codes 0, 1 and 2. Here, we uses check_nrpe which iff it can't connect, it returns 255 (https://github.com/danieljakots/mownitoring/commit/40717e320c04bb0e375f124ef81bed6485605306). So I decided that if the return code is greater or equal to 2, then we consider it's critical. I can't see any return code greater than 2 which may not be critical. --- nagios-nrpe/files/plugins/check_http_many | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagios-nrpe/files/plugins/check_http_many b/nagios-nrpe/files/plugins/check_http_many index e027e23a..243c24b7 100755 --- a/nagios-nrpe/files/plugins/check_http_many +++ b/nagios-nrpe/files/plugins/check_http_many @@ -16,7 +16,7 @@ check_state() { cat $result >> ${result}.err :> $result fi - if [[ $1 -eq 2 ]]; then + if [[ $1 -ge 2 ]]; then critical=true cat $result >> ${result}.err :> $result