2020-03-12 14:57:45 +01:00
|
|
|
#!/bin/bash
|
2020-02-20 16:48:56 +01:00
|
|
|
|
|
|
|
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
|
|
|
|
INTERVAL=750
|
|
|
|
|
|
|
|
last=$(date +"%F %T" -d "$INTERVAL seconds ago")
|
|
|
|
while true;
|
|
|
|
do
|
|
|
|
now=$(date +"%F %T")
|
|
|
|
|
2020-02-27 11:26:26 +01:00
|
|
|
journalctl -u bisq-pricenode --since="$last" --until="$now" | grep -Eo "getAllMarketPrices.*bisq/[0-9].[0-9].[0-9]" | cut -d / -f 2 | sort | uniq -c | while read -r line; do
|
2020-02-20 16:48:56 +01:00
|
|
|
number=$(echo "${line}" | cut -d ' ' -f 1);
|
|
|
|
version=$(echo "${line}" | cut -d \ -f 2);
|
|
|
|
version=${version//./_};
|
|
|
|
echo "PUTVAL $HOSTNAME/requestsPer750Seconds/gauge-v$version interval=$INTERVAL N:$number";
|
|
|
|
done
|
|
|
|
last=$now
|
|
|
|
|
|
|
|
sleep $INTERVAL
|
|
|
|
done
|