1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +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
"""
# MUNIN Plugin to monitor status of Arris TG3442 / TG2492LG-85
# and compatible cable modems
#
# Connect to the web-frontend and get current DOCSIS status of upstream and
# downstream channels. (Signal Power, SNR, Lock Status)
#
#
# Requirements:
# - BeautifulSoup
# - pycryptodome
#
# Configuration:
# [arris]
# env.url http://192.168.100.1
# env.username admin
# env.password yourpassword
#
# Parameters:
# url - URL to web-frontend
# username - defaults to "admin"
# password - valid password
#
#
# References: https://www.arris.com/products/touchstone-tg3442-cable-voice-gateway/
#
#
#
# Copyright (c) 2019 Daniel Hiepler <d-munin@coderdu.de>
#
# 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.
#
#
# Magic markers
# #%# family=contrib
=head1 NAME
arris - MUNIN Plugin to monitor status of Arris TG3442 / TG2492LG-85
and compatible cable modems
=head1 DESCRIPTION
Connect to the web-frontend and get current DOCSIS status of upstream and
downstream channels. (Signal Power, SNR, Lock Status)
=head1 REQUIREMENTS
- BeautifulSoup
- pycryptodome
=head1 CONFIGURATION
=head2 Example
[arris]
env.url http://192.168.100.1
env.username admin
env.password yourpassword
=head2 Parameters
url - URL to web-frontend
username - defaults to "admin"
password - valid password
=head1 REFERENCES
https://www.arris.com/products/touchstone-tg3442-cable-voice-gateway/
=head1 AUTHOR
Copyright (c) 2019 Daniel Hiepler <d-munin@coderdu.de>
Copyright (c) 2004-2009 Nicolas Stransky <Nico@stransky.cx>
Copyright (c) 2018 Lars Kruse <devel@sumpfralle.de>
=head1 LICENSE
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
@ -134,6 +150,7 @@ def login(session, url, username, password):
# set session
r = session.post(f"{url}/php/ajaxSet_Session.php")
def docsis_status(session):
"""get current DOCSIS status page, parse and return channel data"""
r = session.get(f"{url}/php/status_docsis_data.php")
@ -214,7 +231,7 @@ if __name__ == "__main__":
]
# 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
for g in graph_descriptions:
# graph config