mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
python3 only
This commit is contained in:
parent
4d9a7e2cab
commit
21341b5a00
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
=head1 NAME
|
||||
@ -7,7 +7,7 @@ zcash_flypool_hashrate_ - Munin plugin to monitor your zcash.flypool.org hashrat
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
All systems with "python" and "munin"
|
||||
All systems with "python3" and "munin"
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
@ -42,20 +42,11 @@ GPLv2
|
||||
=cut
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import json
|
||||
import codecs
|
||||
|
||||
try:
|
||||
# python3
|
||||
from urllib.request import urlopen
|
||||
from urllib.request import Request
|
||||
except ImportError:
|
||||
# python2
|
||||
from urllib2 import urlopen
|
||||
from urllib2 import Request
|
||||
from urllib.request import urlopen
|
||||
from urllib.request import Request
|
||||
|
||||
command = ''
|
||||
if len(sys.argv) > 1:
|
||||
@ -110,4 +101,4 @@ except:
|
||||
print("No current Hashrate!", file=sys.stderr)
|
||||
sys.exit(9)
|
||||
|
||||
print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate))
|
||||
print("flypool_hs_{}_{}.value {}".format(zcash_address, miner, hash_rate))
|
||||
|
Loading…
Reference in New Issue
Block a user