MikroTik plugin

@ttr I’m taking my virtual hat off in front of you

Screenshot 2021-11-19 104525

How am I integrating this to checkmk?

Very easily. Locate the file /omd/sites/checkmk/local/share/check_mk/checks/agent_mikrotik (attn.: not the special agent) and insert two lines.

Before:

    args += " -p " + quote_shell_string(params["password"])
    args += " -c " + str(params["connect"])

After:

    args += " -p " + quote_shell_string(params["password"])
    if params["nossl"]:
        args += " -n"
    args += " -c " + str(params["connect"])

This should do the trick. If that works for you, I’ll update the package in checkmk exchange.

ttr

1 Like

It works fine after adding that if statement, I’m getting no more errors while rescanning.
However I’m getting a crash report for the temperatures.
I’ll have to investigate further.

as a side note, the MikroTik plugin files from the site had a bunch of errors to be corrected. If you wish I can share my .mkp file with the corrections.

the package is still 1.6, hence the package problems. upgrading is still on my todo but delayed indefinitely. we have a very customized distributed setup, with a huge amount of instances and dozens of plugins we developed by ourselves - and we have no time (as probably all of us here). so migrating package to 2.0 will take some time.

@lucian: concerning your temperature problem: as far as I see from your former post of the plugin output this should work. could you send the relevant parts of the crash report?

ttr

@ttr maybe we can fix it today and post it on the exchange, I bet that would make some people happy.

Regarding the crash report for those 3 services, it looks something like this:

Only thing that changes is the ‘item’ from the variables definition.

Oh, this is 1.6/2.0 stuff. sorry, I can’t fix this by now. It seems following Plugin development: make all includes imports could fix the plugin. Maybe you give it a try.

ttr

@ttr the Plugin development that you recommended in the above post worked just fine.
I just included this in the file at the top of /omd/sites/checmk/local/share/check_mk/checks/mikrotik_temp

from cmk.base.check_legacy_includes.temperature import check_temperature

Thanks!

Also, would you mind sharing it on the exchange too? Would be nice to help others too.

1 Like

Is there a github repository where development for this plugin takes place? Maybe others can contribute to it.

No, not yet and not planned. But feel free to set this up and take maintenance, it’s GPL’ed. Updating this plugin is still on my todo but on very low prio. Upgrading our cmk to 2.0 has started, but will take a while.

ttr

Hi lucian
Do you perhaps have your updated Mikrotik plugin available? We have a number of Mikrotiks but struggling with this version from the exchange portal to get working (skills lacking on the Python front ) lol

I have fixed the WATO part for that plugin, but I am still struggling/lacking knowledge where the agent part can access these values.

In 1.x cmk it was:

special_agents.setdefault('mikrotik', [])

special_agents['mikrotik'] = [
{'condition': {'host_folder': '/%s/' % FOLDER_PATH,
               'host_name': ['mikrotik.beispiel.de']},
 'options': {'comment': u'test ruleset'},
 'value': {'connect': 8728,
           'infos': ['bgp',
                     'ospf',
                     'vrrp',
                     'health',
                     'board',
                     'ipsec',
                     'firewall'],
           'nossl': True,
           'password': 'xxxxxxxx',
           'user': 'checkmk'}},
] + special_agents['mikrotik']

But now it’s like:

static_checks.setdefault('something', [] )
static_checks['something'] = [
{ ... }
] + static_checks['something']

If I figure the last one out, I’ll let you know. For now I have hardcoded the credentials in ~/local/share/check_mk/agents/special/agent_mikrotik

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.