You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: monitoring_base.rb
    path of file: ./repos/zammad/app/models/channel/filter
    
    the code of the file until where you have to start completion: # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/

class Channel::Filter::MonitoringBase
  # according

  # Icinga
  # https://github.com/Icinga/icinga2/blob/master/etc/icinga2/scripts/mail-service-notification.sh
  # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#host-states
  # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/monitoring-basics#service-states

  # Nagios
  # https://github.com/NagiosEnterp
    
  def self.run(_channel, mail, _transaction_params)
    integration = integration_name
    return if !Setting.get("#{integration}_integration")

    sender = Setting.get("#{integration}_sender")
    auto_close = Setting.get("#{integration}_auto_close")
    auto_close_state_id = Setting.get("#{integration}_auto_close_state_id")
    state_ignore_match = Setting.get("#{integration}_ignore_match") || ''
    state_recovery_match = Setting.get("#{integration}_recovery_match") || '(OK|UP)'

    return if mail[:from].blank?
    return if mail[:body].blank?

    session_user_id = mail[ :'x-zammad-session-user-id' ]
    return if !session_user_id

    # check if sender is monitoring
    return if !sender_condition_matching?(mail[:from], sender)

    # get mail attributes like host and state
    result = {}

    mail[:body].gsub(%r{(Service|Host|State|Address|Date/Time|Additional\sInfo|Info|Action|Description):(.+?)(\n|$)}i) do |_match|
      key = $1
      if key
        key = key.downcase
      end
      value = $2
      value&.strip!
      result[key] = value
    end