3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

[fix] localhost name resolution

This commit is contained in:
Ramil Valitov 2020-06-29 15:40:20 +03:00
parent 94f3af4599
commit 6ac9292c0a
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -251,10 +251,11 @@ while IFS= read -r line; do
PrintDebug "Started analysis of pool $line, PID(s): $POOL_PID_ARGS" PrintDebug "Started analysis of pool $line, PID(s): $POOL_PID_ARGS"
#Extract only important information: #Extract only important information:
#Use -P to show port number instead of port name, see https://github.com/rvalitov/zabbix-php-fpm/issues/24 #Use -P to show port number instead of port name, see https://github.com/rvalitov/zabbix-php-fpm/issues/24
#Use -n flag to show IP address and not convert it to domain name (like localhost)
#Sometimes different PHP-FPM versions may have the same names of pools, so we need to consider that. #Sometimes different PHP-FPM versions may have the same names of pools, so we need to consider that.
# It's considered that a pair of pool name and socket must be unique. # It's considered that a pair of pool name and socket must be unique.
#Sorting is required, because uniq needs it #Sorting is required, because uniq needs it
POOL_PARAMS_LIST=$($S_LSOF -P $POOL_PID_ARGS 2>/dev/null | $S_GREP -w -e "unix" -e "TCP" | $S_SORT -u | $S_UNIQ -f8) POOL_PARAMS_LIST=$($S_LSOF -n -P $POOL_PID_ARGS 2>/dev/null | $S_GREP -w -e "unix" -e "TCP" | $S_SORT -u | $S_UNIQ -f8)
FOUND_POOL="" FOUND_POOL=""
while IFS= read -r pool; do while IFS= read -r pool; do
if [[ -n $pool ]]; then if [[ -n $pool ]]; then