mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-27 19:34:43 +00:00
rename
This commit is contained in:
parent
32c7266651
commit
497e66ddcb
2 changed files with 8 additions and 7 deletions
|
@ -29,14 +29,14 @@ if len(sys.argv) > 1:
|
|||
command = sys.argv[1]
|
||||
|
||||
try:
|
||||
eth_address = sys.argv[0].split("_")[1:]
|
||||
eth_address = sys.argv[0][(sys.argv[0].rfind('_')+1):]
|
||||
except ValueError:
|
||||
print("The filename of this plugin (or its symlink) should follow this pattern: "
|
||||
"'<YOUR_PUBLIC_ethEREUM_ADDRESS>'", file=sys.stderr)
|
||||
"'etherscan_balance_<YOUR_PUBLIC_ETHEREUM_ADDRESS>'", file=sys.stderr)
|
||||
sys.exit(9)
|
||||
|
||||
if command == 'config':
|
||||
print("graph_title eth {}".format(eth_address))
|
||||
print("graph_title ETH {}".format(eth_address))
|
||||
print("graph_title Ethereum Address {}".format(eth_address))
|
||||
print("graph_info Ethereum Account Balance for Address {}".format(eth_address))
|
||||
print("graph_title Ethereum Balance")
|
||||
|
@ -47,6 +47,7 @@ if command == 'config':
|
|||
ethercan_balance_api_url = 'https://api.etherscan.io/api?module=account&action=balance&tag=latest&address=' + eth_address
|
||||
|
||||
etherscan_req = urllib2.Request(ethercan_balance_api_url)
|
||||
# User-Agent
|
||||
etherscan_req.add_header('User-Agent', 'Mozilla/5.0')
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue