sensu-plugins / sensu-plugins-microsoft-teams

Sensu plugins for Microsoft Teams

Home Page:http://sensu-plugins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to filter events

Whalurkun opened this issue · comments

commented

Hello and good day.

I have installed and set up the plugin and I get my critical alerts to my teams channel, however the filtering function does not seem to work. I can see from this blog post https://blog.sensu.io/deprecating-event-filtering-in-sensu-plugin-b60c7c500be3 that the filter function is changing. I don't think this is the issue thought, as the filters that I made myself still won't be picked up by the handler either.

I someone can help that would be very much appreciated, I'm about bald form struggling with this.

Here comes my config:

microsoft teams handler config:

  "handlers": {
    "microsoft-teams": {
      "command": "/opt/sensu/embedded/bin/handler-microsoft-teams.rb -j teams",
      "type": "pipe",
      "severities": [
        "critical"
      ],
      "filters": [
        "occurrences",
        "testfilter"
      ]
    }
  },
  "microsoft-teams": {
    "dashboard": "https://redacted.com/#/client/park/",
    "webhook_url": "webhook url redacted",
    "icon_url": "https://raw.githubusercontent.com/sensu/sensu-logo/master/sensu1_flat%20white%20bg_png.png",
    "bot_name": "Sensu"
  }
}

A check would of course contain refresh and occurrences, and have "teams" as the handler.

This is how the testfilter filter looks:

  "filters": {
    "testfilter": {
      "negate": true,
      "attributes": {
         "test123": "test"
      }
    }
  }
}

This is a simple test. Checks with this attribute still gets sent to teams via the handler.

Edited to make code more readable

commented

Closing issue when the problem was related to sensu filters and had nothing to do with the handler.