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

Use the same env variables as FritzConnection

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
(cherry picked from commit 3b0c1395467fb942cbde026058a694780d530828)
This commit is contained in:
Olivier Mehani 2019-09-24 00:12:49 +10:00
parent a20ac8808b
commit 15cc928242
8 changed files with 34 additions and 33 deletions

View File

@ -84,7 +84,8 @@ If you are using the scripts on a different Fritz!Box model please let me know b
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip <ip_address_to_your_fritzbox> env.fritzbox_ip <ip_address_to_your_fritzbox>
env.fritzbox_password <fritzbox_password> env.FRITZ_USERNAME <optional: fritzbox username>
env.FRITZ_PASSWORD <FRITZ_PASSWORD>
env.traffic_remove_max true # if you do not want the possible max values env.traffic_remove_max true # if you do not want the possible max values
host_name fritzbox host_name fritzbox

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -28,10 +28,10 @@ def get_cpu_temperature():
"""get the current cpu temperature""" """get the current cpu temperature"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -28,10 +28,10 @@ def get_cpu_usage():
"""get the current cpu usage""" """get the current cpu usage"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -29,10 +29,10 @@ def get_memory_usage():
"""get the current memory usage""" """get the current memory usage"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)

View File

@ -10,8 +10,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -31,10 +31,10 @@ def get_power_consumption():
"""get the current power consumption usage""" """get the current power consumption usage"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -38,10 +38,10 @@ def get_uptime():
"""get the current uptime""" """get the current uptime"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)

View File

@ -9,8 +9,8 @@
[fritzbox_*] [fritzbox_*]
env.fritzbox_ip [ip address of the fritzbox] env.fritzbox_ip [ip address of the fritzbox]
env.fritzbox_password [fritzbox password] env.FRITZ_PASSWORD [fritzbox password]
env.fritzbox_username [optional: fritzbox username] env.FRITZ_USERNAME [optional: fritzbox username]
This plugin supports the following munin configuration parameters: This plugin supports the following munin configuration parameters:
#%# family=auto contrib #%# family=auto contrib
@ -35,10 +35,10 @@ def get_connected_wifi_devices():
"""gets the numbrer of currently connected wifi devices""" """gets the numbrer of currently connected wifi devices"""
server = os.environ['fritzbox_ip'] server = os.environ['fritzbox_ip']
password = os.environ['fritzbox_password'] password = os.environ['FRITZ_PASSWORD']
if "fritzbox_username" in os.environ: if "FRITZ_USERNAME" in os.environ:
fritzuser = os.environ['fritzbox_username'] fritzuser = os.environ['FRITZ_USERNAME']
session_id = fh.get_session_id(server, password, fritzuser) session_id = fh.get_session_id(server, password, fritzuser)
else: else:
session_id = fh.get_session_id(server, password) session_id = fh.get_session_id(server, password)