Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#658) Manage the when attribute of sensu filters #721

Merged

Conversation

jeffmccune
Copy link
Collaborator

@jeffmccune jeffmccune commented Jul 7, 2017

Without this patch sensu filters are unable to manage the when
attribute

This patch implements the when property on the sensu_filter type and json
provider. The sensu::filter defined type is also updated to support the
when parameter.

The behavior may be exercised with vagrant up el7-client. This will produce
/etc/sensu/conf.d/filters/offhours.json with the content of:

{
 "filters": {
   "offhours": {
     "attributes": {
       "client": {
         "environment": "production"
       }
     },
     "when": {
       "days": {
         "all": [
           {
             "begin": "2:00 AM",
             "end": "1:00 AM"
           }
         ]
       }
     },
     "negate": false
   }
 }
}

Resolves #658

Without this patch sensu filters are unable to manage the [when
attribute](https://sensuapp.org/docs/0.26/reference/filters.html#when-attributes)

This patch implements the `when` property on the sensu_filter type and json
provider.  The `sensu::filter` defined type is also updated to support the
`when` parameter.

The behavior may be exercised with `vagrant up el7-client`.  This will produce
`/etc/sensu/conf.d/filters/offhours.json` with the content of:

    {
      "filters": {
        "offhours": {
          "attributes": {
            "client": {
              "environment": "production"
            }
          },
          "when": {
            "days": {
              "all": [
                {
                  "begin": "2:00 AM",
                  "end": "1:00 AM"
                }
              ]
            }
          },
          "negate": false
        }
      }
    }

Resolves sensu#658
@jeffmccune jeffmccune force-pushed the 658_support_when_attribute_in_filters branch from e43ab62 to 6721c55 Compare July 7, 2017 22:43
@jeffmccune
Copy link
Collaborator Author

Resolves #658 (Waffle isn't associating this PR with the issue for some reason, trying to nudge it.)

@jeffmccune jeffmccune requested a review from ghoneycutt July 7, 2017 23:54
@ghoneycutt ghoneycutt merged commit e88cc97 into sensu:master Jul 8, 2017
@ghoneycutt
Copy link
Collaborator

Released in v2.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants