florentchauveau / kamailio_exporter

Prometheus exporter for Kamailio SIP server
MIT License
57 stars 19 forks source link

Feature: add amount of warnings/errors/criticals for kamailio logs #9

Open sotoz opened 5 years ago

sotoz commented 5 years ago

Hi and thanks for this great exporter.

It would be very nice if we could have the amount of errors/warnings/criticals that kamailio had output to syslog. I will try to investigate how this can be implemented and make a PR if possible. If you have any ideas just say so :)

Thank you.

florentchauveau commented 5 years ago

Hi and thanks!

I guess it all depends on which "errors/warnings/criticals" we are talking about. The exporter can only read from what Kamailio exposes on RPC. On my servers, I do not see those kind of errors exposed, but I suppose this could be done using the statistics module, by incrementing some variable every time you "catch" an error in the script.

However I do not think all errors could be catched this way. Let me know what you find :)

sotoz commented 5 years ago

My first thoughts were to just parse the log file that kamailio uses (ie syslog) and count the amount of ERRORs/WARNINGs etc that it gets outputted there. But I'm not sure if there is a better more native kamailio way with a module. I'll check the statistics module, maybe it has something like that.