-
Notifications
You must be signed in to change notification settings - Fork 1
/
sentArcticoinMetrics.sh
executable file
·38 lines (32 loc) · 1.11 KB
/
sentArcticoinMetrics.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#set -xe
source /usr/local/bin/ddhelper.sh
source /usr/local/bin/tools.sh
host=$(hostname)
coin="arcticcoin"
role="masternode"
username=$(whoami)
coindaemon="arcd"
coincli="arc-cli"
publicIp=$(mypublicip)
coinexplorerurl=http://explorer.advtech.group/api/getblockcount
metricname="node.highestblock"
value=$(/usr/local/bin/$coincli getblockcount)
sentMetric $host $coin $metricname $value $role $username
metricname="node.connections"
value=$(/usr/local/bin/$coincli getconnectioncount)
sentMetric $host $coin $metricname $value $role $username
metricname="node.active"
value=$(/usr/local/bin/$coincli goldminenode list full $publicIp | /bin/grep -w ENABLED | /bin/grep -v PRE-ENABLED | /usr/bin/wc -l)
sentMetric $host $coin $metricname $value $role $username
metricname="node.status"
status=$(/usr/local/bin/$coincli mnsync status | jq .IsSynced)
value=0
if [ 'true' == $status ]; then
value=1
fi
sentMetric $host $coin $metricname $value $role $username
metricname="explorer.highestblock"
highestBlock=$(curl -sk $coinexplorerurl)
value=$highestBlock
sentMetric $host $coin $metricname $value $role $username