Mikrotik plugin V2.4.0 and CHR

Hi everyone,

I’m trying to monitor a Mikrotik CHR (Cloud Hosted Router) from check_mk. Tried using Mikrotik plugin but it does not work as for version checking uses “/system routerboard print” which in CHR outputs:

/system routerboard print
routerboard: no

Maybe using /system resource print would work for both cases but I’m not sure how it would affect the rest of the plugin

Is anyone successfully monitoring CHR in a different way?

Thanks!

Alejandro

Hi,

could you please provide complete output of

/system routerboard print

(run on device). And could you please run special agent:

~/local/share/check_mk/agents/special/agent_mikrotik -u <user> -p <pass> -i board <device>

and send output. Thanks.

ttr

Hi Tom,

thanks for reaching out!

Here’s the output:

[admin@FW-01] > system routerboard print 
  routerboard: no
[admin@FW-01] >

Sounds reasonable as there’s no routerboard, it’s a VM.

OMD[networking]:~/local/share/check_mk/agents/special$ ./agent_mikrotik -n -c8728 --debug -u api_user_ro -p xxxxxxxxxxx -i board 10.138.xx.xxx
<<<check_mk>>>
Version: 2.4.x-mikrotik_agent
Traceback (most recent call last):
  File "./agent_mikrotik", line 359, in <module>
    version=myapi(["/system/routerboard/print"])[0]['current-firmware'].split('.')[0]
KeyError: 'current-firmware'
OMD[networking]:~/local/share/check_mk/agents/special$

Alejandro.-

Hi @fernandeza ,

We’ll get this done.

Kinda strange, mine say some more:

routerboard False
routeros-x86 6.43.2

For now you will have to disable the “RouterOS Board Info” section in the datasource to not crash the agent. Could you please send output of your proposal: system resource print ? I’ll give that a try and will integrate in one of next versions.

ttr

Hi Tom!

There are 2 different flavors x86 intended for physical hardware and CHR intended for cloud / virtual deployments as you may see in: MikroTik Routers and Wireless - Software

With the latest plugin is not enough to disable the board info because it always uses it to switch between ROS6 and ROS7 options

The following example with ipsec section also fails:

OMD[networking]:~/local/share/check_mk/agents/special$ ./agent_mikrotik -n -c8728 --debug -u api_user_ro -p xxxxxxxxxxx -i ipsec 10.138.xx.xxx
<<<check_mk>>>
Version: 2.4.x-mikrotik_agent
Traceback (most recent call last):
  File "./agent_mikrotik", line 359, in <module>
    version=myapi(["/system/routerboard/print"])[0]['current-firmware'].split('.')[0]
KeyError: 'current-firmware'
OMD[networking]:~/local/share/check_mk/agents/special$

Here’s a sample output for system resource print:

[admin@FW-01] > system resource print 
                   uptime: 9h15m53s
                  version: 6.49.7 (stable)
               build-time: Oct/11/2022 14:37:24
              free-memory: 942.4MiB
             total-memory: 992.0MiB
                      cpu: Intel(R)
                cpu-count: 1
            cpu-frequency: 2394MHz
                 cpu-load: 1%
           free-hdd-space: 988.2MiB
          total-hdd-space: 1020.1MiB
  write-sect-since-reboot: 24520
         write-sect-total: 24521
        architecture-name: x86_64
               board-name: CHR
                 platform: MikroTik
[admin@FW-01] >

Alejandro.-

Hi @fernandeza

Thanks for that. I’ll check this out and will update package to support this. We rarely use CHR, so I am focused on physical ones.

Kind regards,
ttr

1 Like

Thanks @ttr

I really appreciate your effort.

If you need help with testing, count on me!

Alejandro.-

1 Like

Hello together

Yesterday I updated the Mikrotik plugin to 2.5.3.
With the CHR instances I now get the error again:

[special_mikrotik]: KeyError: 'name’CRIT

CheckMK Version is 2.2.0p23 .

Are the CHR versions already supported?

Kind regards
Claudio

Hi @Kernal87

it should run on any devices with RouterOS, but I develop this for our hardware devices. Please send more details of your crash.

ttr

1 Like

Hi ttr

Thanks for the support.
I am getting the KeyError: ‘established’ error on both the physical devices and CHR installations.
It does not always occur.

I don’t quite understand the script. Do you have any idea what could be causing this?

As a rule, I have defined BGP Session, Hardware Health and Router Board for the agent.

Agent exited with code 1: Traceback (most recent call last):
File "/omd/sites/[[******]/local/share/check_mk/agents/special/agent_mikrotik", line 484, in <module>
out[i]['established'] = bgpline['established']
~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'established'

A second problem is that I get the message for devices that do not have an integrated power supply. Starting job…

Starting job...
WARNING: Parsing of section mikrotik_power failed - please submit a crash report! (Crash-ID: 87239e78-e14e-11ee-92c9-005056af725d)
Completed.

Hi @Kernal87 ,

sorry for the delay, The first error is fixed in upcoming release and is related to BGP and v7. Power section was reworked in 2.5.4, please wait for new release. I will upload.

ttr

1 Like