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

[fix] args

This commit is contained in:
Ramil Valitov 2020-09-21 20:56:37 +03:00
parent 2fc89b5935
commit 274ba0f318
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -753,11 +753,10 @@ testDiscoverScriptDebug() {
testDiscoverScriptTimeout() { testDiscoverScriptTimeout() {
local DATA local DATA
local NUMBER_OF_ERRORS local NUMBER_OF_ERRORS
local PHP_COUNT DATA=$(sudo -u zabbix sudo "/etc/zabbix/zabbix_php_fpm_discovery.sh" "debug" "sleep" "max_tasks" "1" "/php-fpm-status")
DATA=$(sudo -u zabbix sudo "/etc/zabbix/zabbix_php_fpm_discovery.sh" "debug" "nosleep" "max_tasks" "1" "/php-fpm-status")
NUMBER_OF_ERRORS=$(echo "$DATA" | grep -o -F 'Error:' | wc -l) NUMBER_OF_ERRORS=$(echo "$DATA" | grep -o -F 'Error:' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions)
if [[ $PHP_COUNT != "$NUMBER_OF_ERRORS" ]]; then if [[ $NUMBER_OF_ERRORS -gt 0 ]]; then
local ERRORS_LIST local ERRORS_LIST
ERRORS_LIST=$(echo "$DATA" | grep -F 'Error:') ERRORS_LIST=$(echo "$DATA" | grep -F 'Error:')
printYellow "Errors list:" printYellow "Errors list:"
@ -767,7 +766,8 @@ testDiscoverScriptTimeout() {
travis_fold_end travis_fold_end
fi fi
printElapsedTime printElapsedTime
assertEquals "Discover script errors mismatch" "$PHP_COUNT" "$NUMBER_OF_ERRORS" assertEquals "Discover script errors mismatch" "0" "$NUMBER_OF_ERRORS"
assertExecutionTime
printSuccess "${FUNCNAME[0]}" printSuccess "${FUNCNAME[0]}"
} }
@ -776,9 +776,9 @@ function runZabbixDiscoverReturnsData() {
local IS_OK local IS_OK
local ARG=$1 local ARG=$1
if [[ -n $ARG ]]; then if [[ $ARG == "sleep" ]]; then
# shellcheck disable=SC2140 # shellcheck disable=SC2140
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["$ARG","/php-fpm-status"]) DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["sleep","/php-fpm-status"])
else else
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"])
fi fi