Open Commifreak opened 4 months ago
Just discovered, that my simple change in the matches
created a crash report. Maybe this is somehow interesting?
Exception: TypeError ('item' must be a non empty string or ommited entirely, got '')
Traceback:
File "/omd/sites/l22/bin/cmk", line 112, in <module>
exit_status = modes.call(mode_name, mode_args, opts, args)
File "/omd/sites/l22/lib/python3/cmk/base/modes/__init__.py", line 68, in call
return handler(*handler_args)
File "/omd/sites/l22/lib/python3/cmk/base/modes/check_mk.py", line 1848, in mode_discover
discovery.commandline_discovery(
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/commandline.py", line 80, in commandline_discovery
_commandline_discovery_on_host(
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/commandline.py", line 174, in _commandline_discovery_on_host
service_result = analyse_discovered_services(
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/_discovered_services.py", line 43, in analyse_discovered_services
discovered_services=_discover_services(
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/_discovered_services.py", line 151, in _discover_services
{
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/_discovered_services.py", line 151, in <dictcomp>
{
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/_discovered_services.py", line 304, in _discover_plugins_services
yield from (
File "/omd/sites/l22/lib/python3/cmk/base/agent_based/discovery/_discovered_services.py", line 304, in <genexpr>
yield from (
File "/omd/sites/l22/lib/python3/cmk/base/api/agent_based/register/check_plugins.py", line 73, in filtered_generator
for element in generator(*args, **kwargs):
File "/omd/sites/l22/local/lib/python3/cmk/base/plugins/agent_based/adsl_line.py", line 52, in discover_adsl_line
yield Service(item=oid_end) # item name follows oid enumeration
File "/omd/sites/l22/lib/python3/cmk/base/api/agent_based/checking_classes.py", line 73, in __new__
item=cls._parse_item(item),
File "/omd/sites/l22/lib/python3/cmk/base/api/agent_based/checking_classes.py", line 84, in _parse_item
raise TypeError("'item' must be a non empty string or ommited entirely, got %r" % (item,))
Local variables: {'item': ''}
I added a print (section)
to line 46 to see what values are in use and I got:
[['', '2', '4', '.0.0', '', 'fe004452 41590000', '5.12.29.0_B_A60901', '6', '1', 'SHOWTIME', '0', '48723968', '116030464', '47840256', ''], ['1', '', '', '', '', '', '', '', '', '', '', '', '', '', '116030464'], ['2', '', '', '', '', '', '', '', '', '', '', '', '', '', '47840256']]
Maybe that helps?
Would be AWESOME if we could add 167 support! :)
Could you take a look @f-zappa ?
I managed to get further.
Firstly I dont understand how the register.snmp_section
decides that I get back 3 sections. However, the main issue is, that OIDEnd return int0 for the interface.
By patching the discover function with yield Service(item=(oid_end or '0')) # item name follows oid enumeration
the plugin creates services.
However, the human readable function for the speeds seem to expect another unit, because my up and downstreams are not right formatted.
It seems supporting the 167 needs some more adaptations. I dont have any kind of dev environment but if you decide to continue work on this plugin, I would be more than happy to help with testing.
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.
Feel free to fork this repo and continue the development! If you decide to do so, I will link your repo from here.
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:
I could test something if you want to!