1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 14:16:00 +00:00

fix merge issues

* use 2 newlines to separate toplevel objects
* use string comparision for argument parsing instead of substring search
* remove hashes
* use perldoc style
This commit is contained in:
daniel 2019-06-06 20:56:54 +02:00
parent 17e0fce840
commit 407adbd620

105
plugins/router/arris-tg3442 Normal file → Executable file
View file

@ -1,49 +1,65 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
""" """
# MUNIN Plugin to monitor status of Arris TG3442 / TG2492LG-85 =head1 NAME
# and compatible cable modems
# arris - MUNIN Plugin to monitor status of Arris TG3442 / TG2492LG-85
# Connect to the web-frontend and get current DOCSIS status of upstream and and compatible cable modems
# downstream channels. (Signal Power, SNR, Lock Status)
# =head1 DESCRIPTION
# Connect to the web-frontend and get current DOCSIS status of upstream and
# Requirements: downstream channels. (Signal Power, SNR, Lock Status)
# - BeautifulSoup
# - pycryptodome
# =head1 REQUIREMENTS
# Configuration: - BeautifulSoup
# [arris] - pycryptodome
# env.url http://192.168.100.1
# env.username admin
# env.password yourpassword =head1 CONFIGURATION
#
# Parameters: =head2 Example
# url - URL to web-frontend [arris]
# username - defaults to "admin" env.url http://192.168.100.1
# password - valid password env.username admin
# env.password yourpassword
#
# References: https://www.arris.com/products/touchstone-tg3442-cable-voice-gateway/
# =head2 Parameters
# url - URL to web-frontend
# username - defaults to "admin"
# Copyright (c) 2019 Daniel Hiepler <d-munin@coderdu.de> password - valid password
#
# Permission to use, copy, and modify this software with or without fee
# is hereby granted, provided that this entire notice is included in =head1 REFERENCES
# all source code copies of any software which is or includes a copy or https://www.arris.com/products/touchstone-tg3442-cable-voice-gateway/
# modification of this software.
#
# THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR =head1 AUTHOR
# IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
# REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE Copyright (c) 2019 Daniel Hiepler <d-munin@coderdu.de>
# MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR Copyright (c) 2004-2009 Nicolas Stransky <Nico@stransky.cx>
# PURPOSE. Copyright (c) 2018 Lars Kruse <devel@sumpfralle.de>
#
#
# Magic markers =head1 LICENSE
# #%# family=contrib Permission to use, copy, and modify this software with or without fee
is hereby granted, provided that this entire notice is included in
all source code copies of any software which is or includes a copy or
modification of this software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
PURPOSE.
=head1 MAGIC MARKERS
#%# family=contrib
=cut
""" """
import binascii import binascii
@ -134,6 +150,7 @@ def login(session, url, username, password):
# set session # set session
r = session.post(f"{url}/php/ajaxSet_Session.php") r = session.post(f"{url}/php/ajaxSet_Session.php")
def docsis_status(session): def docsis_status(session):
"""get current DOCSIS status page, parse and return channel data""" """get current DOCSIS status page, parse and return channel data"""
r = session.get(f"{url}/php/status_docsis_data.php") r = session.get(f"{url}/php/status_docsis_data.php")
@ -214,7 +231,7 @@ if __name__ == "__main__":
] ]
# configure ? # configure ?
if len(sys.argv) > 1 and "config" in sys.argv[1]: if len(sys.argv) > 1 and "config" == sys.argv[1]:
# process all graphs # process all graphs
for g in graph_descriptions: for g in graph_descriptions:
# graph config # graph config