-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbitcoind_blockchain_size
More file actions
executable file
·55 lines (36 loc) · 990 Bytes
/
bitcoind_blockchain_size
File metadata and controls
executable file
·55 lines (36 loc) · 990 Bytes
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
#!/bin/sh
# -*- sh -*-
# vim: ft=sh
: << =cut
=head1 NAME
bitcoind_blockchain_size - Plugin to monitor the size of the blockchain
=head1 CONFIGURATION
[bitcoind*]
user bitcoin
env.data_dir /var/lib/bitcoin
=head1 AUTHOR
Cedric Felizard
=head1 LICENSE
AGPLv3+
=head1 MAGIC MARKERS
#%# family=auto
#%# capabilities=autoconf
=cut
DATA_DIR=${data_dir:-"/var/lib/bitcoin"}
BLOCK_DIR="${DATA_DIR}/blocks"
if [ "$1" = "autoconf" ]; then
autoconf="yes"
[ -d $BLOCK_DIR ] || autoconf="no"
echo $autoconf
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Blockchain size'
echo 'graph_vlabel size'
echo 'graph_category bitcoind'
echo 'graph_info This graph shows the size of the blockchain in bytes.'
echo 'bitcoind_blockchain_size.label size'
echo 'bitcoind_blockchain_size.info The size of the blockchain in bytes.'
exit 0
fi
echo "bitcoind_blockchain_size.value $(du --block-size=1 -s $BLOCK_DIR | awk '{print $1}')"