fernandeza
(Alejandro Fernandez)
November 30, 2023, 12:56pm
1
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
ttr
(Tom Tretbar)
December 1, 2023, 8:10am
2
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
fernandeza
(Alejandro Fernandez)
December 1, 2023, 1:18pm
3
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.-
ttr
(Tom Tretbar)
December 1, 2023, 2:29pm
4
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
fernandeza
(Alejandro Fernandez)
December 1, 2023, 7:19pm
5
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.-
ttr
(Tom Tretbar)
December 4, 2023, 8:15am
6
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
fernandeza
(Alejandro Fernandez)
December 4, 2023, 5:32pm
7
Thanks @ttr
I really appreciate your effort.
If you need help with testing, count on me!
Alejandro.-
1 Like
Kernal87
(Kernal87)
March 8, 2024, 1:42pm
8
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
ttr
(Tom Tretbar)
March 11, 2024, 11:19am
9
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
Kernal87
(Kernal87)
March 13, 2024, 2:19pm
10
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.
ttr
(Tom Tretbar)
April 4, 2024, 9:05am
11
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
QDaniel
(QDaniel)
May 13, 2024, 6:54pm
12
@ttr have you for the plugin a Github Repository?
Then can i create a merge request.
I have update a lot of things.
Fix Health Check Error, if Health check disabled
Fix BGP , if bgp connection allow multiple peers
Add Memory, Filesystem and CPU Info from board Section
Add Interfaces
Add Netwatch
Add WireGuard
cschnatz
(Chris)
July 10, 2024, 8:46pm
13
@ttr i would also like to update/add some thinks to your checks like checking DHCP lease and hotspot active user. Can you share a GitHub repo of your plugin? Guess this would make thinks a lot easier.
@QDaniel were can i find your updates? CPU & Memory is very interesting.
QDaniel
(QDaniel)
July 12, 2024, 9:21am
14
i have push it to Github.