From 2192bc31ca1a424b7353c7577fbceb8d4facdbf7 Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Fri, 7 Feb 2020 13:08:15 +0100 Subject: [PATCH] [fix] get port number, not name (#26) --- zabbix/zabbix_php_fpm_discovery.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zabbix/zabbix_php_fpm_discovery.sh b/zabbix/zabbix_php_fpm_discovery.sh index 477e7ea..8f18bc8 100644 --- a/zabbix/zabbix_php_fpm_discovery.sh +++ b/zabbix/zabbix_php_fpm_discovery.sh @@ -237,7 +237,8 @@ while IFS= read -r line; do PrintDebug "Started analysis of pool $line, PID $POOL_PID" #Extract only important information: - POOL_PARAMS_LIST=$($S_LSOF -p "$POOL_PID" 2>/dev/null | $S_GREP -w -e "unix" -e "TCP") + #Use -P to show port number instead of port name, see https://github.com/rvalitov/zabbix-php-fpm/issues/24 + POOL_PARAMS_LIST=$($S_LSOF -P -p "$POOL_PID" 2>/dev/null | $S_GREP -w -e "unix" -e "TCP") FOUND_POOL="" while IFS= read -r pool; do if [[ -n $pool ]]; then