-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbitcoind_blockchain_verification
executable file
·56 lines (37 loc) · 1.15 KB
/
bitcoind_blockchain_verification
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
# -*- sh -*-
# vim: ft=sh
: << =cut
=head1 NAME
bitcoind_blockchain_verification - Plugin to monitor the blockchain verification percentage
=head1 CONFIGURATION
[bitcoind*]
user bitcoin
env.binary bitcoin-cli
env.data_dir /var/lib/bitcoin
=head1 AUTHOR
Cedric Felizard
=head1 LICENSE
AGPLv3+
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
BINARY=${binary:-"/usr/bin/bitcoin-cli"}
DATA_DIR=${data_dir:-"/var/lib/bitcoin"}
if [ "$1" = "autoconf" ]; then
autoconf="yes"
command -v $BINARY >/dev/null || autoconf="no"
echo $autoconf
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Blockchain verification'
echo 'graph_vlabel percentage'
echo 'graph_category bitcoind'
echo 'graph_info This graph shows the blockchain verification progress.'
echo 'bitcoind_blockchain_verification.label blockchain verification'
echo 'bitcoind_blockchain_verification.info The current progress of the blockchain verification.'
exit 0
fi
echo "bitcoind_blockchain_verification.value $($BINARY -datadir=$DATA_DIR getblockchaininfo | grep verificationprogress | grep -o '[0-9.]*')"