Alertik: A tiny syslog server & event notifier for MikroTik routers

Hi,
A few months ago, I attempted to programmatically retrieve logs from my hAP ac^2 and trigger notifications based on those logs. However, I was quickly frustrated to find that RouterOS does not have a native feature for this, and scripting solutions were inadequate due to the human-readable but difficult-to-parse date format. Adding to the complexity was the log polling, which made my script increasingly convoluted.

Unfortunately, I’m not alone in facing this issue, as evidenced by:

I then discovered that RouterOS supports a syslog client, which theoretically could resolve the issues with date parsing and polling. However, I did not want to dedicate a machine for this purpose. This led to the creation of Alertik: a simple, 395kB syslog server written in C, available as a Docker image and compact enough to run directly on my hAP ac^2 from its ramdisk.

Alertik is capable of receiving logs from RouterOS and triggering notifications based on log matches, whether through substring or regex. It is configurable via environment variables, supports custom messages, and integrates with Telegram, Slack, Discord, and Teams (with potential support for other services via WebHooks).

Project:
https://github.com/Theldus/alertik

3 Likes

Awesome!

I had a similar idea , I was thinking about HA ( home assistant ) notify via Speaker , Txt msg and LED lights for RouterOS notifications , lol . I’ll make sure to share, If I get that far.

I’m not a telegram or Discord user . ( I am Lame ) , Perhaps notify via Google :smiley:

Shouldn’t be difficult to add a Google Chat webhook handler, or just configure it to POST to Google’s webhook URLs with the right JSON format. Since, most of Google’s notification services expect simple JSON payloads anyway.

If I get it going , I’ll throw a commit you way, if you’re cool with that :smile: .

Does your compiled C version support the MIkrotik MIPSBE platform as well? I can only find mention of ARM in your repo? Thanks

Simply mipsbe do not support container.