HenriWahl / checkmk-agent-plugin-yum

Checks for updates on RPM-based distributions via yum.
GNU General Public License v2.0
24 stars 22 forks source link

1.6.0CEE: TypeError (inventory_yum() takes exactly 2 arguments (1 given)) #20

Closed robertoschwald closed 4 years ago

robertoschwald commented 4 years ago

Updated to 1.6.0p2 CEE. Some RPM hosts give this error while trying to perform discovery:

TypeError (inventory_yum() takes exactly 2 arguments (1 given))

Traceback

 File "/omd/sites/symentis/lib/python/cmk_base/decorator.py", line 54, in wrapped_check_func
    status, infotexts, long_infotexts, perfdata = check_func(hostname, *args, **kwargs)
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 420, in check_discovery
    on_error="raise")
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 1039, in _get_host_services
    return _get_node_services(host_config, ipaddress, sources, multi_host_sections, on_error)
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 1047, in _get_node_services
    multi_host_sections, on_error)
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 1080, in _get_discovered_services
    multi_host_sections, on_error)
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 824, in _discover_services
    check_plugin_name, on_error):
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 926, in _execute_discovery
    discovered_items = _execute_discovery_function(discovery_function, section_content)
  File "/omd/sites/symentis/lib/python/cmk_base/discovery.py", line 955, in _execute_discovery_function
    discovered_items = discovery_function(section_content)

Local Variables

{'discovery_function': <function inventory_yum at 0x7fa1ec4869b0>,
 'section_content': [[u'no'], [u'0']]}

Check Type: discovery Description: Check_MK Discovery

Output:

<<<yum:cached(1569850892,1800)>>>
no
0
d0m4f commented 4 years ago

open local/share/check_mk/checks/yum and change

#def inventory_yum(checkname, info):
def inventory_yum(info):
robertoschwald commented 4 years ago

See PR #21

HenriWahl commented 4 years ago

Uploaded 2.0.9 contains the fix from above PR.