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

silence action does not work with sensu v0.29+ #7

Open
autumnw opened this issue Aug 3, 2017 · 5 comments
Open

silence action does not work with sensu v0.29+ #7

autumnw opened this issue Aug 3, 2017 · 5 comments

Comments

@autumnw
Copy link

autumnw commented Aug 3, 2017

Sensu API was changed, the old api "/stashes" does not work any more.
Instead, should use "/silenced". It was already implemented in https://github.com/sangoma/pysensu/blob/master/pysensu/api.py

@LindsayHill
Copy link
Contributor

Their docs seem to indicate it is still supported? https://sensuapp.org/docs/latest/api/stashes-api.html

I can't quite figure it out though, as some older docs talk about migrating from stash-based silencing https://sensuapp.org/docs/0.26/reference/silencing.html#migrating-from-stash-based-silencing

Looks like it should be pretty straightforward to change the actions if we need to though. Don't even need to change the names.

@pietervogelaar
Copy link

+1 Silence action doesn't work. I'm running Sensu version 1.0.2 and stackstorm-sensu pack v0.5.0

@LindsayHill
Copy link
Contributor

@pietervogelaar so what changes need to be made? When I looked at this earlier, it seemed that they did still support /stashes - is that no longer the case? Can you submit a PR to make calls to a different Sensu API, if that is what is required?

@arunsr2015
Copy link

arunsr2015 commented May 6, 2019

@LindsayHill I hit the same issue, looks like stashes for silence does not work, i modified the action a bit and i can see the check silenced in sensu ui

`
class SilenceAction(SensuAction):
def run(self, check, client, expiration, message):
path = 'silence/{}'.format(client)
if check:
path = "{}/{}".format(path, check)

    payload = {}
    payload['message'] = message

    if expiration:
        payload['expire'] = expiration

    if check:
        payload['check'] = check

    if client:
        payload['subscription'] = client


    #return self.api.create_stash(payload, path)
    return self.api.post_silence_request(payload)

`

@LindsayHill
Copy link
Contributor

Please submit a PR with that change

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

No branches or pull requests

4 participants