Monitoring services by status mails

Hello,

I am looking for a way to monitor various services by parsing the status emails they send. This is neccessary because a) this is (in some cases) the only way to monitor them and b) there is no reliable, secure connection to them.

So I need something that consumes incoming mails, parses them for the originating host, service and its status (Success, Failure, etc.) and turns this into a check result. It should also raise a status of UNKNOWN when no mail is received within a defined time frame.

I don’t know if this is possible as a check plugin, or if it would be better to run a separate service that generates passive check results via the Icinga API. For the latter, I took a look into Huginn which might do what I want, but looks very complicated. I do not want any online service for that, 100% self-hosted/on-premises is required.

Any ideas?

Thanks,
Andreas

Hi there,

… I need something that consumes incoming mails, parses them for
the originating host, service and its status (Success, Failure,
etc.) and turns this into a check result. It should also raise a
status of UNKNOWN when no mail is received within a defined time
frame.

Understood.

I don’t know if this is possible as a check plugin, or if it would
be better to run a separate service that generates passive check
results via the Icinga API.

I have several check plugins which read a file from somewhere in the
filesystem, the file being written by something like a cron job. It
would be the sort of thing I’d be thinking about in your situation.

… I took a look into Huginn … looks very complicated.

I don’t think it need be complicated. Better if it isn’t. :slight_smile:

I do not want any online service for that, 100%
self-hosted/on-premises is required.

Wouldn’t have it any other way. :slight_smile:

Any ideas?

Several! But a little bit more information needed.

Are you running a mail server which accepts these emails, or are you
fetching them with POP or IMAP or something like that from a provider?

You could use an MTA’s filtering mechanisms to forward the messages to
a script, which parses them and writes a file in /tmp/ - or something
like that. Then a check_plugin could read the file, log stuff, etc…

If it’s POP/IMAP there are tools which could work but I’d perhaps be
cautious about the likely reliability of it. Ideally the mails would
be sent (or forwarded) to an address not used for anything else.

This looks like it could be the right tool for the job but it looks complicated to set up.

1 Like

@Andreas_H I found your post as I am looking into the same problem. I would definitely go the route with a script that fetches mails from a mailbox, parses them and pushes the passive check results via the icinga API.

Have you looked around if some “simple” script exists that could be used as a starting point?

For me it is mainly for backup jobs that run daily, so the script would check for mails from the backup systems and update the status of the backup “service” in icinga.