mirror of
https://github.com/rvalitov/zabbix-php-fpm.git
synced 2023-11-05 03:30:27 +01:00
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.
This commit is contained in:
parent
a748ddfc90
commit
9acb7224d2
@ -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 ","
|
||||
|
Loading…
Reference in New Issue
Block a user