2023-07-16 02:09:52 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
[[ $# -eq 0 ]] || exit 1
|
|
|
|
|
|
|
|
user=root
|
|
|
|
|
|
|
|
. hosts.sh
|
|
|
|
|
|
|
|
function print_stat() {
|
|
|
|
echo $1 ${stats["$1"]}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare -n hosts=hosts_dns
|
|
|
|
for host in ${hosts[@]}; do
|
|
|
|
echo $host
|
|
|
|
echo
|
|
|
|
|
|
|
|
declare -A stats
|
|
|
|
for field in $(ssh $user@$host "pdns_control show '*'" | tr ',' '\n'); do
|
|
|
|
IFS== read key value <<<$field
|
|
|
|
stats[$key]=$value
|
|
|
|
done
|
|
|
|
|
2024-02-03 17:30:22 -05:00
|
|
|
print_stat uptime
|
2023-07-16 02:09:52 -04:00
|
|
|
print_stat backend-queries
|
2024-03-28 10:05:41 -04:00
|
|
|
print_stat tcp-queries
|
|
|
|
print_stat udp-queries
|
2023-07-16 02:09:52 -04:00
|
|
|
print_stat latency
|
|
|
|
print_stat receive-latency
|
|
|
|
print_stat backend-latency
|
|
|
|
print_stat send-latency
|
|
|
|
|
|
|
|
echo
|
|
|
|
done
|