Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some functionality to the mail collector #41

Closed
Lacrymology opened this issue Dec 26, 2014 · 3 comments
Closed

Add some functionality to the mail collector #41

Lacrymology opened this issue Dec 26, 2014 · 3 comments

Comments

@Lacrymology
Copy link
Contributor

This is about the collector I sent in #40

There's one main thing I'd like to add right now that is the possibility of collecting metrics for more than one domain hosted in the server. The main idea behind the mailbox_prefix configuration key was to be able to define more than one instance of the collector, each with a different prefix and path (at least our path to the different domain spools are /var/mail/vhosts/<domain>/), but I just realized that's not possible.

So what do you think would be the best way of configuring this to have:

  • from /var/mail/vhosts/example.com collect metrics with prefix example_com
  • from /var/mail/vhosts/example.net collect metrics with prefix example.net
  • etc

My first thought was to pass /var/mail/vhosts/* as a glob and then automatically add the vhost name as a prefix, but the real distribution inside /var/mail depends on the mail server and configuration, the only thing the standard says is that you should have plain text files named <username> in the UNIX mailbox format for each user's mailbox. But our server has, besides /var/mail/vhosts/<domain>, /var/mail/vhosts/indexes/, and in there there's a lot of random imap information (the different users folders, trash, history, etc)

Another posible approach woud be:

[[MailCollector]]
spool_path = /var/mail         # this will be published without prefix
[[[example_com]]]
spool_path = /var/mail/vhosts/example.com    # prefix=example_com
[[[example_net]]]
spool_path = /var/mail/vhosts/example.net     # prefix=example_net
@kormoc
Copy link
Contributor

kormoc commented Jan 2, 2015

Well, with the new functionality to run a collector multiple times, wouldn't it be better to just run it one time per domain with a different path and spool_path set per collector?

@Lacrymology
Copy link
Contributor Author

wait, I missed this. Sure it would (it was my original idea)

Can you point me to the right spot?

@shortdudey123
Copy link
Member

See comments in #675 on running multiple instances of a collector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants