Giter VIP home page Giter VIP logo

stackstorm-nagios's Introduction

Nagios integration

To integrate Nagios with st2, we will need to add a nagios event handler which POSTs a HTTP webbhook to st2.

Nagios event handler

The event handler script is available at etc/st2service_handler.py.

Configuring the event handler

The event handler tries to register a trigger type first before sending any notifications to st2. This trigger type is then referenced in st2 rules. See rules/ for examples.

Installing the event handler

  1. Pick the nagios host where you want the event handler to be placed.

  2. Copy st2service_handler.py and st2service_handler.yaml to /usr/local/nagios/libexec/

    cp etc/st2service_handler.* /usr/local/nagios/libexec/
  3. Make sure st2service_handler.py is executable.

    chmod +x /usr/local/nagios/libexec/st2service_handler.py
  4. Handlers require a configuration file (See etc/st2service_handler.yaml) containing st2 credentials, st2 API URL and st2 auth URL, st2 API Key, Unauthed and SSL Verify Flag.

  5. Test the event handler manually.

    python st2service_handler.py st2service_handler.yaml 44534 3 WARNING HARD "/var/log" 4 host-name
    # You'd see something like the following if the test succeeds.
    Sent nagios event to st2. HTTP_CODE: 202

Handler options

  1. The handler supports unauthed st2 endpoints (server side authentication turned off). Though this is not recommended, you can use this for local testing. To turn on the unauthed flag to true in st2service_handler.yaml

    unauthed: True
    
  2. The handler also supports turning on/off ssl verification for all API requests to st2. By default, SSL verification is turned off as evaluation versions of st2 ship with self-signed certs. To turn on ssl verify, change the flag in st2service_handler.yaml to True.

    ssl_verify: True
    
  3. If for whatever reason, you've to debug the handler, you can use the --verbose option.

    python st2service_handler.py st2service_handler.yaml 44534 3 WARNING HARD "/var/log" 4 host-name --verbose

stackstorm-nagios's People

Contributors

arm4b avatar blag avatar cognifloyd avatar emedvedev avatar jfryman avatar kami avatar lindsayhill avatar manasdk avatar nmaludy avatar philipphomberger avatar vishnu81 avatar warrenvw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stackstorm-nagios's Issues

Payload Fields are missing

replace triggers/service_state_change.yaml with the attached file.
If not the exception criteria fields in stackstorm wont work as intended.
you may redo the datatypes. i just set almost everything to "string" so i can test out if this is the root cause of the issue or not
service_state_change.zip

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.