1
0
mirror of https://github.com/Tafkas/fritzbox-munin.git synced 2023-10-10 13:36:55 +02:00

consistent naming

This commit is contained in:
Christian Stade-Schuldt 2015-06-05 01:07:00 +02:00
parent 2bd15e836d
commit 4db75d0fec
2 changed files with 7 additions and 7 deletions

View File

@ -21,21 +21,21 @@ from fritzconnection import FritzConnection
def print_values():
try:
con = FritzConnection()
conn = FritzConnection()
except Exception as e:
sys.exit("Couldn't get WAN traffic")
down_traffic = con.call_action('WANCommonInterfaceConfig', 'GetTotalBytesReceived')['NewTotalBytesReceived']
down_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetTotalBytesReceived')['NewTotalBytesReceived']
print ('down.value %d' % down_traffic)
up_traffic = con.call_action('WANCommonInterfaceConfig', 'GetTotalBytesSent')['NewTotalBytesSent']
up_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetTotalBytesSent')['NewTotalBytesSent']
print ('up.value %d' % up_traffic)
max_down_traffic = con.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
max_down_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
'NewLayer1DownstreamMaxBitRate']
print ('maxdown.value %d' % max_down_traffic)
max_up_traffic = con.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
max_up_traffic = conn.call_action('WANCommonInterfaceConfig', 'GetCommonLinkProperties')[
'NewLayer1UpstreamMaxBitRate']
print ('maxup.value %d' % max_up_traffic)

View File

@ -21,11 +21,11 @@ from fritzconnection import FritzConnection
def print_values():
try:
connection = FritzConnection()
conn = FritzConnection()
except Exception as e:
sys.exit("Couldn't get connection uptime")
uptime = connection.call_action('WANIPConnection', 'GetStatusInfo')['NewUptime']
uptime = conn.call_action('WANIPConnection', 'GetStatusInfo')['NewUptime']
print ('uptime.value %.2f' % (int(uptime) / 86400.0))