Giter VIP home page Giter VIP logo

Comments (8)

lcx avatar lcx commented on June 29, 2024 1

since this is showing up when searching for "serverites handler sensu" and I just wasted several hours trying to figure out why I am receiving notifications for warnings although I wanted only critical ...

severites != severities

so instead of

"severites": ["critical", "unknown"]

use

"severities": ["critical", "unknown"]

from sensu-plugins-slack.

lacion avatar lacion commented on June 29, 2024

having the same issue

from sensu-plugins-slack.

dlukman avatar dlukman commented on June 29, 2024

+1

from sensu-plugins-slack.

mnuessler avatar mnuessler commented on June 29, 2024

Try to put everything into a single file, like so:

{
    "handlers": {
        "slack": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb",
            "severites": ["critical", "unknown"]
        }
    },
    "slack": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}  

This is how I got it working. If it still does not work, please check that all required config entries are present. The exception shown in your sensu log looks as if the handler is relying on a config entry that is nil (see also #6).

from sensu-plugins-slack.

dlukman avatar dlukman commented on June 29, 2024

@mnuessler Thanks! It worked.

from sensu-plugins-slack.

eheydrick avatar eheydrick commented on June 29, 2024

Can you try the latest release.

from sensu-plugins-slack.

eraldobernardino-luizalabs avatar eraldobernardino-luizalabs commented on June 29, 2024

Hi guys!

{
    "handlers": {
        "slack": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb",
            "severites": ["critical", "unknown"]
        }
    },
    "slack": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}  

This form works to me, but a need to create two handlers and two differents slack webhooks, one for production ( slack channel like #production and one for staging ( slack channel like #staging.).
I tried create two configuration files like slack_production.json and slack_staging.json, but when it send message to slack it to send for only on channel.

Can anybody help me?

Tks

{
    "handlers": {
        "slack-staging": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb",
            "severites": ["critical", "unknown"]
        }
    },
    "slack": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}  
{
    "handlers": {
        "slack-production": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb",
            "severites": ["critical", "unknown"]
        }
    },
    "slack": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}  

from sensu-plugins-slack.

eugene-chow avatar eugene-chow commented on June 29, 2024

@eraldobernardino-luizalabs The Slack handler's config need to be named differently. Try the JSON below. I renamed the Slack config for each environment, and then pointed the handler to the respective config with -j config_name

{
    "handlers": {
        "slack-staging": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb -j slack-staging",
            "severites": ["critical", "unknown"]
        }
    },
    "slack-staging": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}
{
    "handlers": {
        "slack-production": {
            "type": "pipe",
            "command": "/usr/local/bin/handler-slack.rb -j slack-production",
            "severites": ["critical", "unknown"]
        }
    },
    "slack-production": {
        "webhook_url": "https://hooks.slack.com/services/...",
        "template" : ""
    }
}

from sensu-plugins-slack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.