3
0
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:
Ramil Valitov 2020-07-07 05:30:24 +03:00
parent 56c7251842
commit 2b2dfa435d
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -218,12 +218,13 @@ function discoverAll() {
fi
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"
return 0
else
DATA_COUNT=$(echo "$DATA_COUNT + 1" | bc)
if [[ $DATA_COUNT -gt 10 ]]; then
echo "Data old: $DATA_OLD, data new: $DATA"
return 1
fi
discoverAll "$DATA" "$DATA_COUNT"
@ -233,6 +234,9 @@ function discoverAll() {
testZabbixDiscoverNumberOfStaticPools() {
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"static' | wc -l)
@ -244,6 +248,9 @@ testZabbixDiscoverNumberOfStaticPools() {
testZabbixDiscoverNumberOfDynamicPools() {
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"dynamic' | wc -l)
@ -255,6 +262,9 @@ testZabbixDiscoverNumberOfDynamicPools() {
testZabbixDiscoverNumberOfOndemandPoolsCold() {
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
@ -286,14 +296,12 @@ testZabbixDiscoverNumberOfOndemandPoolsHot() {
fi
done <<<"$PHP_LIST"
OLD_DATA=""
DATA="1"
while
[[ $OLD_DATA != "$DATA" ]]
OLD_DATA="$DATA"
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"])
do true; done
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions)
@ -304,6 +312,9 @@ testZabbixDiscoverNumberOfOndemandPoolsHot() {
testZabbixDiscoverNumberOfIPPools() {
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"localhost",' | wc -l)
@ -315,6 +326,9 @@ testZabbixDiscoverNumberOfIPPools() {
testZabbixDiscoverNumberOfPortPools() {
DATA=$(discoverAll)
STATUS=$?
if [[ $STATUS -ne 0 ]]; then
echo "$DATA"
fi
assertEquals "Failed to discover all data" "0" "$STATUS"
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"port' | wc -l)