bisq/pricenode/journalscraper_hsversion.sh
Florian Reimair 57157c7e4f
Report HS version to pricenode (#4027)
* Report HS version to pricenode

In order to evaluate progress on https://github.com/bisq-network/projects/issues/23,
the Bisq app reports its hiddenservice version.

This change is going to be undone as soon as we do not need the
info anymore.

* Added hsversion scraper script

* Added installer/uninstaller

* Cleanup

* Fix unit name
2020-04-02 16:06:00 +02:00

21 lines
568 B
Bash
Executable File

#!/bin/bash
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}"
INTERVAL=750
last=$(date +"%F %T" -d "$INTERVAL seconds ago")
while true;
do
now=$(date +"%F %T")
journalctl -u bisq-pricenode --since="$last" --until="$now" | grep -Eo "getAllMarketPrices.*HSv[0-9]" | grep -o "HSv[0-9]" | sort | uniq -c | while read -r line; do
number=$(echo "${line}" | cut -d ' ' -f 1);
version=$(echo "${line}" | cut -d \ -f 2);
version=${version//./_};
echo "PUTVAL $HOSTNAME/hsversionStats/gauge-$version interval=$INTERVAL N:$number";
done
last=$now
sleep $INTERVAL
done