Sysadmin Life Hack: Syslog and NodeRed, a match made in heaven
I recently wanted to react to events detected by some obscure hardware monitoring device, using NodeRED. I was not exactly sure how to achieve this, because the device doesn’t really offer any method of accessing it via an API or something. Of course these devices often can send mail or SNMP traps, but I didn’t want to involve a mail server or deal with OIDs, so I kept looking for a different solution.
Another protocol that is actually quite widely supported is syslog.
Since I had a syslog-ng
instance running to send logs to
Loki, I wondered if it would be possible to also send the logs to MQTT.
Indeed this works, and it allowed me to implement my use-case quite
easily. But ever since, I kept finding new applications for this: The
syslog protocol is ubiquitous, and even the cheapest routers support
it.
I’m going to lay out a few details on how it works.