Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can select if you want to check your IMAP or POP3 login. It would be best to have your login credentials for your Email Mailbox.

Image Modified


  • Forward emails as events to Event Console

    • Forwarding Method

      You can select if you want to send the events to the Event Console or a remote syslog host. If you want to send the events to the local EC, we recommend using the spooling mechanism.

      The check will store all collected events in one file in ~/var/mkeventd/spool using the spooling mechanism.


      Code Block
      languagebash
      themeRDark
      OMD[mysite]:~$ ll ~/var/mkeventd/spool/
      total 3600
      -rw-rw---- 1 mysite mysite 79124 Dec 7 15:36 mysite_407343_1607351778
      -rw-rw---- 1 mysite mysite 79124 Dec 7 15:37 mysite_408329_1607351841
      


...

You need to be aware that a subject field could contain line breaks. This is depending on your mail client and mail gateway. You could check the raw email to find out how many line breaks you have.

Image Modified

.

Now you can use regex platforms like regex101.com to create a regex.

Image Modified

.

For advanced debugging:
.

...

For debugging reasons, it could be helpful to run the check manually. Therefore, you need to open the service site of the Email service and search for 'Service check command'. Now you can use the command for executing the check manually.

Image Modified


Image Modified


Code Block
languagebash
themeRDark
title~/lib/nagios/plugins
OMD[mysite]:~/lib/nagios/plugins$ ./check_mail --pwstore=6@11@strato '--protocol=IMAP' '--server=imap.provider.de' '--ssl' '--port=993' '--username=user@provider.com' '--password=*************' '--forward-ec' '--forward-method=spool:' '--match-subject=Checkmk EC' '--forward-facility=2' '--forward-host=localhost' '--cleanup=delete'
OK - Forwarded 0 messages to event console | messages=0

...

The Event would look like this:

Image Modified

...