From c2e27d025c581bfc914b6e0f361254805203d030 Mon Sep 17 00:00:00 2001 From: William Hirigoyen Date: Mon, 24 Jul 2023 15:35:09 +0200 Subject: [PATCH] nagios-nrpe: add brackets in check grep --- nagios-nrpe/files/check-local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagios-nrpe/files/check-local b/nagios-nrpe/files/check-local index 40587425..8fcc3da8 100755 --- a/nagios-nrpe/files/check-local +++ b/nagios-nrpe/files/check-local @@ -6,7 +6,7 @@ if ! test -f /usr/lib/nagios/plugins/check_nrpe; then fi if [ -r /etc/nagios/nrpe.d/evolix.cfg ]; then - command=$(grep "check_$1" /etc/nagios/nrpe.d/evolix.cfg | grep -v '^[[:blank:]]*#' | tail -n1 | cut -d'=' -f2-) + command=$(grep "\[check_$1\]" /etc/nagios/nrpe.d/evolix.cfg | grep -v '^[[:blank:]]*#' | tail -n1 | cut -d'=' -f2-) echo "Command:" echo " $command" fi