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

[fix] options

This commit is contained in:
Ramil Valitov 2020-09-21 20:41:38 +03:00
parent 993d5e0c49
commit 2fc89b5935
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -774,16 +774,15 @@ testDiscoverScriptTimeout() {
function runZabbixDiscoverReturnsData() {
local DATA
local IS_OK
local OPTIONS='"/php-fpm-status"'
local ARG=$1
local ARG_ID=1
local ARGS_COUNT=$#
if [[ -n $ARG ]]; then
# shellcheck disable=SC2140
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["$ARG","/php-fpm-status"])
else
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"])
fi
while [ $ARG_ID -le $ARGS_COUNT ]; do
OPTIONS="$OPTIONS,\"$1\""
done
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["$OPTIONS"])
IS_OK=$(echo "$DATA" | grep -F '{"data":[{"{#POOLNAME}"')
printElapsedTime
assertNotNull "Discover script failed: $DATA" "$IS_OK"