mirror of
https://github.com/rvalitov/zabbix-php-fpm.git
synced 2023-11-05 03:30:27 +01:00
[fix] pools check
This commit is contained in:
parent
45dbf7de0b
commit
9cb128461d
@ -159,16 +159,14 @@ testZabbixDiscoverSimilarSocketPoolNames() {
|
|||||||
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"])
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"socket1",' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"socket1",' | wc -l)
|
||||||
PHP_COUNT=$(getNumberOfPHPVersions)
|
PHP_COUNT=$(getNumberOfPHPVersions)
|
||||||
POOLS=$(echo "($PHP_COUNT * $MAX_POOLS)/1" | bc)
|
assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS"
|
||||||
assertEquals "Found $NUMBER_OF_POOLS pools instead of $POOLS" "$NUMBER_OF_POOLS" "$POOLS"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testZabbixDiscoverSimilarHttpPoolNames() {
|
testZabbixDiscoverSimilarHttpPoolNames() {
|
||||||
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"])
|
||||||
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"http1",' | wc -l)
|
NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"http1",' | wc -l)
|
||||||
PHP_COUNT=$(getNumberOfPHPVersions)
|
PHP_COUNT=$(getNumberOfPHPVersions)
|
||||||
POOLS=$(echo "($PHP_COUNT * $MAX_POOLS)/1" | bc)
|
assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS"
|
||||||
assertEquals "Found $NUMBER_OF_POOLS pools instead of $POOLS" "$NUMBER_OF_POOLS" "$POOLS"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load shUnit2.
|
# Load shUnit2.
|
||||||
|
Loading…
Reference in New Issue
Block a user