Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Import Macro Repair

...

        1. Copy the plugin to the local path.

          Code Block
          languagebash
          themeRDark
          OMD[mysite]:~/lib/nagios/plugins$ cp check_mail ~/local/lib/nagios/plugins/

          .

        2. Add a print for the subject

          Code Block
          languagebash
          themeRDark
               for index, msg in sorted(mails.items()):
                   subject = msg.get('Subject', 'None')
                   print(subject)

          .

        3. Run the script manually

          Code Block
          languagebash
          themeRDark
          OMD[mysite]:~/lib/nagios/plugins$ ./check_mail --pwstore=6@17@password_1 '--fetch-protocol=IMAP' '--fetch-server=imap.strato.de' '--fetch-tls' '--fetch-port=993' '--fetch-username=user@provider.com' '--fetch-password=*************' '--connect-timeout=10' '--forward-ec' '--match-subject=.*Incident.*\n.*assigned' 
          =?utf-8?Q?Incident_INC000000XXXX_has_bee?=
           =?utf-8?Q?n_assigned_to_your_group_'XXXX=
           =?utf-8?Q?XXXXX'_=XXXXX:_Comuni?=
           =?utf-8?Q?XXXXX_-_Priority:_Low?=
          =?utf-8?Q?Incident_INC000000XXXX_has_bee?=
           =?utf-8?Q?n_assigned_to_your_group_'XXXX=
           =?utf-8?Q?XXXXX'_=XXXXX:_Comuni?=
           =?utf-8?Q?XXXXX_-_Priority:_Low?=
          Forwarded 2 messages to event console | messages=2
          
          

          .

    • Events: Syslog facility

Use this syslog facility for all created events.

...