Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-1194

Configuring file logging from the alerting system

Details

    • Improvement
    • Resolution: Won't Do
    • Major
    • None
    • None
    • Alerting
    • None

    Description

      This patch introduces configurable filebased logging to Observium using a template to describe the notification.
      Configuration is done in the local configuration.
      Default configuration is extended with 3 options:

      // File log backend settings
      $config['filelog']['enable'] = FALSE; // Enable/Disable filelog globally
      $config['filelog']['log_dir'] = $config['install_dir'] . '/logs'; // Log dir. No trailing /
      $config['filelog']['log_name'] = 'alerts.log'; // Log name.

      The code has been formatted according to the syntax described on the Observium wiki.
      In order to make this work the alerter needs a described contact_method.
      Insert a contact_method = filelog in the alert_contacts table, and create your mappings by inserting the desired records into alert_contact_assoc.
      These mappings are based on the alert_tests id’s.

      Attachments

        Activity

          [OBS-1194] Configuring file logging from the alerting system
          landy Mike Stupalov made changes -
          Resolution New: Won't Do [ 10001 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          landy Mike Stupalov made changes -
          Workflow Original: classic default workflow [ 12079 ] New: Observium workflow [ 13030 ]

          This was obsoleted by the contact system changes, but can probably be more easily reimplemented now.

          adama Adam Armstrong added a comment - This was obsoleted by the contact system changes, but can probably be more easily reimplemented now.
          gdeboer Gert-Jan de Boer made changes -
          Attachment New: logstash-observium-filter.conf [ 12287 ]
          gdeboer Gert-Jan de Boer added a comment - - edited

          Attaching the filter we're using to catch the alerts in Elasticsearch.

          Is there a chance you'll accept this patch? I don't see it breaking anything and it helps our use case.

          gdeboer Gert-Jan de Boer added a comment - - edited Attaching the filter we're using to catch the alerts in Elasticsearch. Is there a chance you'll accept this patch? I don't see it breaking anything and it helps our use case.

          Just tested it, with two contacts I get both email and filelog alerts so it seems to work as intended.

          gdeboer Gert-Jan de Boer added a comment - Just tested it, with two contacts I get both email and filelog alerts so it seems to work as intended.
          gdeboer Gert-Jan de Boer made changes -
          Attachment Original: mb_add_filelog_baserev_6252.diff [ 12273 ]
          gdeboer Gert-Jan de Boer made changes -
          Attachment New: mb_add_filelog_baserev_6252_nlfilter.diff [ 12274 ]

          Updated patch, including newline filter.

          gdeboer Gert-Jan de Boer added a comment - Updated patch, including newline filter.

          We want to feed alerts into elasticsearch so we can search them and correlate them with other systems. Easiest way to accomplish that was getting alerts into a logfile. When you insert two contacts in alert_contacts and add the proper associations in alert_contacts_assoc it should do both email and filelog, wouldn't it?

          gdeboer Gert-Jan de Boer added a comment - We want to feed alerts into elasticsearch so we can search them and correlate them with other systems. Easiest way to accomplish that was getting alerts into a logfile. When you insert two contacts in alert_contacts and add the proper associations in alert_contacts_assoc it should do both email and filelog, wouldn't it?

          People

            adama Adam Armstrong
            gdeboer Gert-Jan de Boer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: