ITRS-Group / monitor-merlin

Module for Effortless Redundancy and Loadbalancing In Naemon
https://itrs-group.github.io/monitor-merlin/
GNU General Public License v2.0
22 stars 14 forks source link

Log config errors with Naemons log function #88

Closed jacobbaungard closed 3 years ago

jacobbaungard commented 3 years ago

Messages printed to stdout/err from the Merlin module, is not detected by the system journal on CentOS. As a result, we would have issues where Naemon failed to start, due to a error with the merlin config, but the log messages explaining why is no where to be seen. The previous workaround would be to start Naemon manually instead of via systemd to see the errors.

To fix this we use Naemons logging functionality instead, which means we correctly get the merlin errors printed to stdout/err and they are correctly logged to the system journal, for troubleshooting.

This also works in the daemon, as nm_log just prints to stdout/err in case there are no Naemon log file.

This fixes: MON-9151

Signed-off-by: Jacob Hansen jhansen@op5.com

jacobbaungard commented 3 years ago

rebased on master