From 5120249e5987c1440c0eb6a13d6aaa9bb65cc4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Dubois?= Date: Wed, 18 Jan 2023 17:44:03 +0100 Subject: [PATCH] nagios-nrpe : fix check_vrrpd grep "17" was able to grep "170" --- nagios-nrpe/files/plugins/check_vrrpd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nagios-nrpe/files/plugins/check_vrrpd b/nagios-nrpe/files/plugins/check_vrrpd index 5cd50027..a82c379b 100755 --- a/nagios-nrpe/files/plugins/check_vrrpd +++ b/nagios-nrpe/files/plugins/check_vrrpd @@ -118,7 +118,7 @@ if [ ${#ID_master[@]} -ne 0 ]; then for i in "${ID_master[@]}"; do # If array contains the current ID, then a process exist, and we have to make sure the corresponding interface exists if [[ " ${ID_running_vrrpd[*]} " =~ " $i " ]]; then - vrrpd_current_proccess=$(echo "$vrrpd_processes" | grep -E -- "-v $i") + vrrpd_current_proccess=$(echo "$vrrpd_processes" | grep -E -- "-v $i ") INT_current_vrrpd=$(echo "$vrrpd_current_proccess" | grep -Eo -- "-i \S+" | awk '{print $2}') IP_current_vrrpd=$(echo "$vrrpd_current_proccess" | grep -Eo "${regex_ipv4}|${regex_ipv6}") if [ "$used_daemon" = "vrrpd" ]; then @@ -145,7 +145,7 @@ if [ ${#ID_backup[@]} -ne 0 ]; then for i in "${ID_backup[@]}"; do # If array contains the current ID, then a process exist, and we have to make sure the corresponding interface does not exist if [[ " ${ID_running_vrrpd[*]} " =~ " $i " ]]; then - vrrpd_current_proccess=$(echo "$vrrpd_processes" | grep -E -- "-v $i") + vrrpd_current_proccess=$(echo "$vrrpd_processes" | grep -E -- "-v $i ") INT_current_vrrpd=$(echo "$vrrpd_current_proccess" | grep -Eo -- "-i \S+" | awk '{print $2}') IP_current_vrrpd=$(echo "$vrrpd_current_proccess" | grep -Eo "${regex_ipv4}|${regex_ipv6}") if [ "$used_daemon" = "vrrpd" ]; then