influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.9k stars 5.6k forks source link

Input plugin for exim #2374

Closed fahimeh2010 closed 7 years ago

fahimeh2010 commented 7 years ago

Hello all First thank you for your open source project. I need to monitor exim but I think there is no input plugin for exim. it will be so useful . Thank you

Feature Request

sparrc commented 7 years ago

please open a new request and fill out the "feature request" template, linking to relevant documentation on how metrics can be collected if available

adeverteuil commented 7 years ago

Hi, sorry for necroposting, but I did a bit of research and development to achieve this and I have some recommendation for @fahimeh2010 and anyone Googling this.

Exim doesn't provide an interface for metrics collection. Instead, it produces very extensive and well documented logs. The logparser plugin is the best choice to get statistics from Exim.

Here is how I configured it: https://github.com/adeverteuil/ansible-playbooks/blob/develop/roles/telegraf/templates/exim.conf.j2

It doesn't get much, just the message size for each received and sent messages. I just have a low-volume personnal mail server, so it's sufficient for me, but there is potential for lots more.

Unfortunately there isn't a de facto log format standard like Apache's combined log, so anyone wishing to do something similar will need to learn the Logparser plugin configuration, the Grok language, and do testing and development for their own particular Exim log_selector configuration and desired metrics output.

See also my Exim log_selector configuration, for comparison with your own: https://github.com/adeverteuil/ansible-playbooks/blob/develop/roles/mailserver/templates/exim4.conf.j2#L268

There are lots of references commented in my exim.conf file. Here they are for convenience:

danielnelson commented 7 years ago

@adeverteuil Thanks for adding the information, if you are interested you could add a new section to the logparser README with a guide to setting it up to parse exim log files. Also, any suggestions for improving the docs would be appreciated, since logparser is quite hard to get started with.