mirror of
https://github.com/rvalitov/zabbix-php-fpm.git
synced 2023-11-05 03:30:27 +01:00
[add] more details
This commit is contained in:
parent
56c7251842
commit
2b2dfa435d
32
tests/all.sh
32
tests/all.sh
@ -218,12 +218,13 @@ function discoverAll() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
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"])
|
||||||
if [[ $DATA_OLD == "$DATA" ]]; then
|
if [[ "$DATA_OLD" == "$DATA" ]]; then
|
||||||
echo "$DATA"
|
echo "$DATA"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc)
|
DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc)
|
||||||
if [[ $DATA_COUNT -gt 10 ]]; then
|
if [[ $DATA_COUNT -gt 10 ]]; then
|
||||||
|
echo "Data old: $DATA_OLD, data new: $DATA"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
discoverAll "$DATA" "$DATA_COUNT"
|
discoverAll "$DATA" "$DATA_COUNT"
|
||||||
@ -233,6 +234,9 @@ function discoverAll() {
|
|||||||
testZabbixDiscoverNumberOfStaticPools() {
|
testZabbixDiscoverNumberOfStaticPools() {
|
||||||
DATA=$(discoverAll)
|
DATA=$(discoverAll)
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
|
echo "$DATA"
|
||||||
|
fi
|
||||||
assertEquals "Failed to discover all data" "0" "$STATUS"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"static' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"static' | wc -l)
|
||||||
@ -244,6 +248,9 @@ testZabbixDiscoverNumberOfStaticPools() {
|
|||||||
testZabbixDiscoverNumberOfDynamicPools() {
|
testZabbixDiscoverNumberOfDynamicPools() {
|
||||||
DATA=$(discoverAll)
|
DATA=$(discoverAll)
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
|
echo "$DATA"
|
||||||
|
fi
|
||||||
assertEquals "Failed to discover all data" "0" "$STATUS"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"dynamic' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"dynamic' | wc -l)
|
||||||
@ -255,6 +262,9 @@ testZabbixDiscoverNumberOfDynamicPools() {
|
|||||||
testZabbixDiscoverNumberOfOndemandPoolsCold() {
|
testZabbixDiscoverNumberOfOndemandPoolsCold() {
|
||||||
DATA=$(discoverAll)
|
DATA=$(discoverAll)
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
|
echo "$DATA"
|
||||||
|
fi
|
||||||
assertEquals "Failed to discover all data" "0" "$STATUS"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
|
||||||
@ -286,14 +296,12 @@ testZabbixDiscoverNumberOfOndemandPoolsHot() {
|
|||||||
fi
|
fi
|
||||||
done <<<"$PHP_LIST"
|
done <<<"$PHP_LIST"
|
||||||
|
|
||||||
OLD_DATA=""
|
DATA=$(discoverAll)
|
||||||
DATA="1"
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
while
|
echo "$DATA"
|
||||||
[[ $OLD_DATA != "$DATA" ]]
|
fi
|
||||||
OLD_DATA="$DATA"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"])
|
|
||||||
do true; done
|
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
|
||||||
PHP_COUNT=$(getNumberOfPHPVersions)
|
PHP_COUNT=$(getNumberOfPHPVersions)
|
||||||
@ -304,6 +312,9 @@ testZabbixDiscoverNumberOfOndemandPoolsHot() {
|
|||||||
testZabbixDiscoverNumberOfIPPools() {
|
testZabbixDiscoverNumberOfIPPools() {
|
||||||
DATA=$(discoverAll)
|
DATA=$(discoverAll)
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
|
echo "$DATA"
|
||||||
|
fi
|
||||||
assertEquals "Failed to discover all data" "0" "$STATUS"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"localhost",' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"localhost",' | wc -l)
|
||||||
@ -315,6 +326,9 @@ testZabbixDiscoverNumberOfIPPools() {
|
|||||||
testZabbixDiscoverNumberOfPortPools() {
|
testZabbixDiscoverNumberOfPortPools() {
|
||||||
DATA=$(discoverAll)
|
DATA=$(discoverAll)
|
||||||
STATUS=$?
|
STATUS=$?
|
||||||
|
if [[ $STATUS -ne 0 ]]; then
|
||||||
|
echo "$DATA"
|
||||||
|
fi
|
||||||
assertEquals "Failed to discover all data" "0" "$STATUS"
|
assertEquals "Failed to discover all data" "0" "$STATUS"
|
||||||
|
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"port' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"port' | wc -l)
|
||||||
|
Loading…
Reference in New Issue
Block a user