Giter Club home page Giter Club logo

check_mk_adsl_line's Introduction

⚠️ Sorry, but I won't put more effort into this plugin. FTTH is coming to our village, we already have the empty tube in our house and are waiting for the actual fibre which should come within the rest of the year. After that, we don't need DSL anymore.

Check-MK plugin for monitoring adsl lines

This Check checks status of an ADSL line via the SNMP ADSL-LINE-MIB. Written for and tested with a DrayTek Vigor165, should work on other DrayTek ADSL routers/modems and probably with other hardware (feedback is welcome).

If want to try this with other Hardware than Vigor165/160/130, you will need to adjust the snmp_scan_function.

The ADSL line is usually on interface #4, although this should be autodiscovered by the plugin.

New Version (>1.1) requires CMK >2.0.0! If you use an older version, look in the v0.7 branch (but be warned, this code is really ugly).

check_mk_adsl_line's People

Contributors

f-zappa avatar bernhardschmidt avatar

Stargazers

 avatar  avatar  avatar

Watchers

James Cloos avatar Sven Roederer avatar  avatar  avatar

check_mk_adsl_line's Issues

No further information from Vigor 165 than via included SNMP check --> Crash Report

Hi and thanks für the additional information about the modem state via Check_MK.
I installed version 0.7 on 1.6.0.p16, but I get a "Crash Report":

  • Exception: TypeError (argument of type 'NoneType' is not iterable)
  • Traceback
  File "/omd/sites/heimat/lib/python/cmk_base/checking.py", line 320, in execute_check
    raw_result = check_function(item, determine_check_params(params), section_content)
  File "/omd/sites/heimat/local/share/check_mk/checks/adsl_line", line 40, in check_adsl_line
    if 'downstream_params' in params:
  • Local Variables
{'info': [[u'4',
           u'2',
           u'2',
           u'.0.0',
           u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
           u'DRAYTEK\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
           u'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
           u'6',
           u'13',
           u'SHOWTIME\x00\x00\x00\x00\x00\x00\x00\x00\x00',
           u'-1',
           u'293330780',
           u'285473000',
           u'46717000']],
 'item': u'4',
 'params': None}
  • Crash Type: check
  • Time: 2022-05-29 15:12:49
  • Operating System: bionic
  • Check_MK Version: 1.6.0p16
  • Edition: cee
  • Core: cmc
  • Python Version: 2.7.17 (default, Aug 19 2020, 06:42:08) [GCC 8.4.0]
  • Python Module Paths
/opt/omd/versions/1.6.0p16.cee/bin
/omd/sites/heimat/local/lib/python
/omd/sites/heimat/lib/python/_pdbpp_path_hack
/omd/sites/heimat/lib/python27.zip
/omd/sites/heimat/lib/python2.7
/omd/sites/heimat/lib/python2.7/plat-linux2
/omd/sites/heimat/lib/python2.7/lib-tk
/omd/sites/heimat/lib/python2.7/lib-old
/omd/sites/heimat/lib/python2.7/lib-dynload
/omd/sites/heimat/lib/python2.7/site-packages
/omd/sites/heimat/lib/python

Please let me know if you need more information to fix.
Shall I update the site to 2.x and retry with version 1.1 again?

Best regards,
Razorworks

invalid output from agent or error in check implementation??

Hey there,

been trying out the MKP-extension on my Vigor165 and do get the above error in service discovery of CMK 1.6P6. SNMP detects an ADSL-line on interface 4, but errors out then:

invalid check parameter: The type must be a dictionary, but it is a NoneType
Variable: checkgroup_parameters:adsl_line
Parameters:None

edit added crash output:

2020-01-02_163942

Been using the device as a bridged-modem, do you have any hint, what could be wrong here?

TY
Don

GUI rule can only overwrite upstream_rate parameter

I navigate the GUI to Setup > Services > Service monitoring rules > Metrics of ADSL line and create a "New rule: Metrics of ADSL line". In the "Value" section, this allows me to set "Upstream Rate", but not the other parameters (like SNR margin).

This is Checkmk Raw Edition 2.1.0p18 and adsl_line 1.3

Please update to new firmware - new 4.2.5 has upload info back in on SNMP

Woa, I wondered why CheckMK totally feel like crashing, trying to use your plugin after updating to 4.2.5. I then checked the change-logs of the Draytek-guys and discovered the upload-statistics could be found back in SNMP. But Draytek has chosen to change the OIDs fully around. I have really tried to fool around with your code, but did not figure out finally to get it fixed... But then I am no coder at all... Could you please fix the OID-changes? I am lost otherwise, this MIB you put in the packet does also confuse me.... NAS.mib? Really, that feels like a placeholder? Could you please be so kind, to have a look, and if you have no more access to such device, then please abandon the project. Anyway thank you, Frank! Nice share :)
Oh, I forgot - I am using thing the Vigor165 as a modem, I loved your devotion to detail! Safe living, Frank!

Installation and runtime problems

Hi @f-zappa

Thank you for this plugin.

I'm a total newbie when it comes to check_mk so please bear with me.

My setup

  • Check_mk 2.1.0p3 running in Docker (podman)

I downloaded your mkp and copied it to the container and tried to install via mkp -v install adsl_line-1.1.mkp. This resulted in the following error:

Installing /omd/sites/test/var/check_mk/packages/adsl_line version 1.1.
File conflict: /omd/sites/cmk/local/lib/check_mk/base/plugins/agent_based/adsl_line.py already existing.
OMD[cmk]:~/downloads$ rm /omd/sites/cmk/local/lib/check_mk/base/plugins/agent_based/adsl_line.py /omd/sites/cmk/local/share/check_mk/checkman/adsl_line /omd/sites/cmk/local/share/check_mk/web/plugins/metrics/adsl_line.py /omd/sites/cmk/local/share/check_mk/web/plugins/wato/adsl_line.py /omd/sites/cmk/local/share/snmp/mibs/NAS.mib
OMD[cmk]:~/downloads$ mkp -v install adsl_line-1.1.mkp 
Installing /omd/sites/test/var/check_mk/packages/adsl_line version 1.1.
  Agent based plugins (Checks, Inventory):
    adsl_line.py
    Fixing permissions of /omd/sites/cmk/local/lib/check_mk/base/plugins/agent_based/adsl_line.py: 0640 -> 0644
  Checks' man pages:
    adsl_line
    Fixing permissions of /omd/sites/cmk/local/share/check_mk/checkman/adsl_line: 0640 -> 0644
  Legacy GUI extensions:
    plugins/metrics/adsl_line.py
    plugins/wato/adsl_line.py
    Fixing permissions of /omd/sites/cmk/local/share/check_mk/web/plugins/metrics/adsl_line.py: 0640 -> 0644
    Fixing permissions of /omd/sites/cmk/local/share/check_mk/web/plugins/wato/adsl_line.py: 0640 -> 0644
  SNMP MIBs:
    NAS.mib
    Fixing permissions of /omd/sites/cmk/local/share/snmp/mibs/NAS.mib: 0640 -> 0644
Traceback (most recent call last):
  File "/omd/sites/cmk/bin/check_mk", line 92, in <module>
    exit_status = modes.call(mode_name, mode_args, opts, args)
  File "/omd/sites/cmk/lib/python3/cmk/base/modes/__init__.py", line 69, in call
    return handler(*handler_args)
  File "/omd/sites/cmk/lib/python3/cmk/base/modes/check_mk.py", line 742, in mode_packaging
    cmk.base.packaging.do_packaging(args)
  File "/omd/sites/cmk/lib/python3/cmk/base/packaging.py", line 90, in do_packaging
    f(args)
  File "/omd/sites/cmk/lib/python3/cmk/base/packaging.py", line 300, in package_install
    packaging.install_by_path(path)
  File "/omd/sites/cmk/lib/python3/cmk/utils/packaging.py", line 398, in install_by_path
    return install(file_object=cast(BinaryIO, f))
  File "/omd/sites/cmk/lib/python3/cmk/utils/packaging.py", line 514, in install
    write_package_info(package)
  File "/omd/sites/cmk/lib/python3/cmk/utils/packaging.py", line 785, in write_package_info
    with pkg_info_path.open("w", encoding="utf-8") as f:
  File "/omd/sites/cmk/lib/python3.9/pathlib.py", line 1252, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/omd/sites/cmk/lib/python3.9/pathlib.py", line 1120, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/omd/sites/test/var/check_mk/packages/adsl_line'

I was able to fix this by changing the the name in the metadata of your package to /omd/sites/cmk/var/check_mk/packages/adsl_line . I guess there is a better way to fix this though :)

After the package is successfully installed I goto Setup > Services > Service Monitoring Rules and add a rule. This looks like this and seems to be broken to me:

image

Vigor167 Support

I have an Vigor 167 and thought I could simply add the 167 to the matches line, but CMK seems to ignore that live change.

However, maybe you could add support for it?

.1.3.6.1.2.1.1.1.0 => DrayTek Corporation, Router Model: Vigor167, Version: 5.2.4, Build Date/Time: Thu Jan 18 11:23:14 CST 2024

The dsl OID block:

.1.3.6.1.2.1.10.94.1.1.1.1.1.0 2
.1.3.6.1.2.1.10.94.1.1.1.1.2.0 4
.1.3.6.1.2.1.10.94.1.1.1.1.3.0 .0.0
.1.3.6.1.2.1.10.94.1.1.1.1.4.0 VDSL2
.1.3.6.1.2.1.10.94.1.1.1.1.5.0 DEFVAL
.1.3.6.1.2.1.10.94.1.1.2.1.1.0 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
.1.3.6.1.2.1.10.94.1.1.2.1.2.0 b5004244 434db221
.1.3.6.1.2.1.10.94.1.1.2.1.3.0 "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 "
.1.3.6.1.2.1.10.94.1.1.2.1.4.0 11
.1.3.6.1.2.1.10.94.1.1.2.1.5.0 9
.1.3.6.1.2.1.10.94.1.1.2.1.6.0 SHOWTIME
.1.3.6.1.2.1.10.94.1.1.2.1.7.0 0
.1.3.6.1.2.1.10.94.1.1.2.1.8.0 148539392
.1.3.6.1.2.1.10.94.1.1.3.1.1.0 
.1.3.6.1.2.1.10.94.1.1.3.1.2.0 fe004452 41590000
.1.3.6.1.2.1.10.94.1.1.3.1.3.0 5.12.29.0_B_A60901
.1.3.6.1.2.1.10.94.1.1.3.1.4.0 6
.1.3.6.1.2.1.10.94.1.1.3.1.5.0 1
.1.3.6.1.2.1.10.94.1.1.3.1.6.0 SHOWTIME
.1.3.6.1.2.1.10.94.1.1.3.1.7.0 0
.1.3.6.1.2.1.10.94.1.1.3.1.8.0 48723968
.1.3.6.1.2.1.10.94.1.1.4.1.1.0 0
.1.3.6.1.2.1.10.94.1.1.4.1.2.0 116030464
.1.3.6.1.2.1.10.94.1.1.4.1.3.0 0
.1.3.6.1.2.1.10.94.1.1.4.1.4.0 0
.1.3.6.1.2.1.10.94.1.1.5.1.1.0 0
.1.3.6.1.2.1.10.94.1.1.5.1.2.0 47840256
.1.3.6.1.2.1.10.94.1.1.5.1.3.0 0
.1.3.6.1.2.1.10.94.1.1.5.1.4.0 0

I could test something if you want to!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.