Giter Site home page Giter Site logo

hubot-nagios's Introduction

hubot-nagios

hubot-nagios adds nagios monitoring support to hubot

Build Status

Description

This plugin enables hubot to react to nagios notification as well as request current service state or acknowledge problems.

It requires custom notification commands and a contact on the nagios side as well. On notification nagios runs a simple curl call to relay the event to hubot. For this to work, hubot needs to listen on an IP that is reachable from nagios.

Installation and Setup

Add hubot-nagios to your package.json, run npm install and add hubot-nagios to external-scripts.json.

Add hubot-nagios to your package.json dependencies.

"dependencies": {
  "hubot-nagios": ">= 0.0.1"
}

Add hubot-nagios to external-scripts.json.

> cat external-scripts.json
> ["hubot-nagios"]

You need to specify the chat room to use for build events and the cctray.xml to use on startup:

% HUBOT_NAGIOS_EVENT_NOTIFIER_ROOM="#roomname" \
  bin/hubot

Within nagios configuration you need to add a new contact that calls the hubot webhook:

define contact {
        alias                          hubot
        host_notification_period       24x7
        service_notification_options   w,u,c,r
        contact_name                   hubot
        email                          [email protected]
        host_notification_options      d,r
        service_notification_period    24x7
        service_notification_commands  notify-service-by-hubot
        host_notification_commands     notify-host-by-hubot
}

And add this new contact as a member to at least one contactgroup.

You need to add these new commands:

define command {
        command_name                    notify-service-by-hubot
        command_line                    /usr/bin/curl -d host="$HOSTALIAS$" -d serviceoutput="$SERVICEOUTPUT$" -d servicedescription="$SERVICEDESC$" -d notificationtype="$NOTIFICATIONTYPE$" -d servicestate="$SERVICESTATE$" https://username:[email protected]/hubot/nagios/service
}

define command {
        command_name                    notify-host-by-hubot
        command_line                    /usr/bin/curl -d host="$HOSTNAME$" -d hostoutput="$HOSTOUTPUT$" -d notificationtype="$NOTIFICATIONTYPE$" -d hoststate="$HOSTSTATE$" https://username:[email protected]/hubot/nagios/host
}

That's it!

hubot-nagios's People

Contributors

fbernitt avatar

Watchers

 avatar

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.