Service Erkennung Mikrotik API

Hi danke, da liegt also doch noch ein fehler vor mit der librouteros und dem Plugin.
muss ich mir noch mal genauer anschauen.

[special_mikrotik] No persisted sections loaded
[special_mikrotik] Not using cache (Don’t try it)
[special_mikrotik] Execute data source
[special_mikrotik] Calling external program “/omd/sites/mysite/local/share/check_mk/agents/special/agent_mikrotik -u ‘red-man’ -p ‘password’ -c 2001 -i bgp,ospf,vrrp,health,board ‘192.168.199.1’”
[special_mikrotik] ERROR: Agent exited with code 1: Traceback (most recent call last):
File “/omd/sites/mysite/local/share/check_mk/agents/special/agent_mikrotik”, line 189, in
api = connect(username=user, password=password, host=host, ssl_wrapper=ctx.wrap_socket, port=port)
File “/omd/sites/mysite/local/lib/python/librouteros/init.py”, line 41, in connect
transport = create_transport(host, **arguments)
File “/omd/sites/mysite/local/lib/python/librouteros/init.py”, line 69, in create_transport
raise ConnectionError(error)
librouteros.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:727)

Traceback (most recent call last):
File “/omd/sites/mysite/bin/cmk”, line 94, in
exit_status = modes.call(mode_name, mode_args, opts, args)
File “/omd/sites/mysite/lib/python/cmk_base/modes/init.py”, line 72, in call
return mode.handler_function(*handler_args)
File “/omd/sites/mysite/lib/python/cmk_base/modes/check_mk.py”, line 1498, in mode_discover
discovery.do_discovery(hostnames, options.get(“checks”), options[“discover”] == 1)
File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 134, in do_discovery
multi_host_sections = _get_host_sections_for_discovery(sources, use_caches=use_caches)
File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 906, in _get_host_sections_for_discovery
return sources.get_host_sections(max_cachefile_age)
File “/omd/sites/mysite/lib/python/cmk_base/data_sources/init.py”, line 279, in get_host_sections
host_sections_from_source = source.run()
File “/omd/sites/mysite/lib/python/cmk_base/data_sources/abstract.py”, line 133, in run
raw_data, is_cached_data = self._get_raw_data()
File “/omd/sites/mysite/lib/python/cmk_base/data_sources/abstract.py”, line 182, in _get_raw_data
raw_data = self._execute()
File “/omd/sites/mysite/lib/python/cmk_base/data_sources/programs.py”, line 61, in _execute
return self._get_agent_info_program(command_line, command_stdin)
File “/omd/sites/mysite/lib/python/cmk_base/data_sources/programs.py”, line 109, in _get_agent_info_program
raise MKAgentError(“Agent exited with code %d: %s” % (exitstatus, stderr))
cmk_base.exceptions.MKAgentError: Agent exited with code 1: Traceback (most recent call last):
File “/omd/sites/mysite/local/share/check_mk/agents/special/agent_mikrotik”, line 189, in
api = connect(username=user, password=password, host=host, ssl_wrapper=ctx.wrap_socket, port=port)
File “/omd/sites/mysite/local/lib/python/librouteros/init.py”, line 41, in connect
transport = create_transport(host, **arguments)
File “/omd/sites/mysite/local/lib/python/librouteros/init.py”, line 69, in create_transport
raise ConnectionError(error)
librouteros.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:727)

ich hatte zwischen meinen Posts die agent_mikrotik geupdatet bei meinen test hatte ich gesehen das er die agent_mikrotik und immer eine SSL verbindung aufbaut, dieses hatte ich handisch angepassst.

api = connect(username=user, password=password, host=host, ssl_wrapper=ctx.wrap_socket, port=port)
auf
api = connect(username=user, password=password, host=host, port=port)

aber bei dem von dir genannten aufruf erhalte ich weiter Script fehler, ich denke also das die beiden Scripte nicht mehr zusammenpassen.

Loading autochecks from /omd/sites/mysite/var/check_mk/autochecks/maingate.mk
[piggyback] No persisted sections loaded
[piggyback] Execute data source
No piggyback files for ‘maingate’. Skip processing.
No piggyback files for ‘192.168.199.1’. Skip processing.

  • EXECUTING DISCOVERY PLUGINS (19)
    Trying discovery with: if64_tplink, mikrotik_bgp, hr_cpu, mikrotik_ospf, hr_mem, snmp_uptime, check_mk.only_from, check_mk.agent_update, mikrotik_vrrp, mikrotik_fan, hr_ps, mikrotik_temp, if64adm, if64, mikrotik_signal, hr_fs, mikrotik_power, snmp_info, mikrotik_board
    The discovery function “inventory_mikrotik_bgp” of the check “mikrotik_bgp” is expected to take a single argument (info or parsed), but it’s taking the following arguments: [‘checkname’, ‘info’]. You will have to change the arguments of the discovery function to make it compatible with this Checkmk version.
    Traceback (most recent call last):
    File “/omd/sites/mysite/bin/cmk”, line 94, in
    exit_status = modes.call(mode_name, mode_args, opts, args)
    File “/omd/sites/mysite/lib/python/cmk_base/modes/init.py”, line 72, in call
    return mode.handler_function(*handler_args)
    File “/omd/sites/mysite/lib/python/cmk_base/modes/check_mk.py”, line 1498, in mode_discover
    discovery.do_discovery(hostnames, options.get(“checks”), options[“discover”] == 1)
    File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 137, in do_discovery
    only_new, on_error)
    File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 171, in _do_discovery_for
    on_error=on_error)
    File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 838, in _discover_services
    check_plugin_name, on_error):
    File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 951, in _execute_discovery
    discovery_function = _get_discovery_function_of(check_plugin_name)
    File “/omd/sites/mysite/lib/python/cmk_base/discovery.py”, line 979, in _get_discovery_function_of
    (discovery_function.name, check_plugin_name, discovery_function_args))
    cmk.utils.exceptions.MKGeneralException: The discovery function “inventory_mikrotik_bgp” of the check “mikrotik_bgp” is expected to take a single argument (info or parsed), but it’s taking the following arguments: [‘checkname’, ‘info’]. You will have to change the arguments of the discovery function to make it compatible with this Checkmk version.