From 9acb7224d28a6de849030ef912a59bc299260682 Mon Sep 17 00:00:00 2001 From: LeoShivas <28844182+LeoShivas@users.noreply.github.com> Date: Tue, 26 Nov 2019 11:46:52 +0100 Subject: [PATCH] Update zabbix_php_fpm_discovery.sh Replace $(NF-1) by $(NF). I don't know, but on my CentOs server, the commande "lsof -p 1179 2>/dev/null | grep unix | head -1" gives me : php-fpm 1179 php-fpm 24u unix 0xffff8f77b774dc00 0t0 8958617 /local/php/sockets/php7_mediawiki.sock So, the socket is in the last row, not in the before last. --- zabbix/zabbix_php_fpm_discovery.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zabbix/zabbix_php_fpm_discovery.sh b/zabbix/zabbix_php_fpm_discovery.sh index cbed091..f9237e6 100644 --- a/zabbix/zabbix_php_fpm_discovery.sh +++ b/zabbix/zabbix_php_fpm_discovery.sh @@ -47,7 +47,7 @@ while IFS= read -r line do POOL_PID=`printf '%s\n' "${PS_LIST[@]}" | $S_GREP "php-fpm: pool $line" | $S_HEAD -1 | $S_AWK '{print $1}'` if [[ ! -z $POOL_PID ]]; then - POOL_SOCKET=`$S_LSOF -p $POOL_PID 2>/dev/null | $S_GREP unix | $S_HEAD -1 | $S_AWK '{ print $(NF-1)}'` + POOL_SOCKET=`$S_LSOF -p $POOL_PID 2>/dev/null | $S_GREP unix | $S_HEAD -1 | $S_AWK '{ print $(NF)}'` if [[ ! -z $POOL_SOCKET ]]; then if [[ $POOL_FIRST == 1 ]]; then echo -n ","