GithubHelp home page GithubHelp logo

lita-nagios's Introduction

lita-nagios

Build Status Coverage Status

lita-nagios is a handler for Lita that allows interaction with Nagios monitoring solution. It listens for notifications on a HTTP endpoint and uses nagiosharder to send commands to the Nagios instance.

Note: Colors in notifications are not enabled yet, because it relies completely on the adapter and no abstraction layer is implemented nor designed as of now.

Installation

Add lita-nagios to your Lita instance's Gemfile:

gem "lita-nagios"

Configuration

HTTP interface

  • default_room (String) - Default chat room for notifications

Nagios commands (nagiosharder config)

  • cgi - Nagios CGI URL
  • user - Nagios user with system commands authorization
  • pass - User password
  • version - Nagios version, default: 3
  • time_format - default: "iso8601"
  • verify_ssl - default: true

Example

Lita.configure do |config|
  config.handlers.nagios.default_room = "#admin_room"
  config.handlers.nagios.cgi = "http://nagios.example.com/cgi-bin/nagios3"
  config.handlers.nagios.user = "lita"
  config.handlers.nagios.pass = "xxxx"
  config.handlers.nagios.version = 3
  config.handlers.nagios.time_format = "iso8601"
  config.handlers.nagios.verify_ssl = true
end

Usage

Display notifications in channel

lita-nagios provides a HTTP endpoint to receive Nagios notifications:

POST /nagios/notifications

Request parameters must include those fields:

  • type - host or service
  • room - notifications destination (see default_room in configuration section)
  • host - Nagios' $HOSTNAME$ or $HOSTALIAS$
  • output - Nagios' $HOSTOUTPUT$ or $SERVICEOUTPUT$
  • state - Nagios' $HOSTSTATE$ or $SERVICESTATE$
  • notificationtype - Nagios' $NOTIFICATIONTYPE$
  • description - Nagios' $SERVICEDESC$ (only for service type)

An example Nagios configuration (contact, commands) to send alerts to channels is provided in contrib folder

Send commands to Nagios

lita: nagios enable notif(ication(s)) <-h | --host HOST> [-s | --service SERVICE] - Enable notifications for given host/service
lita: nagios disable notif(ication(s)) <-h | --host HOST> [-s | --service SERVICE] - Disable notifications for given host/service
lita: nagios recheck <-h | --host HOST> [-s | --service SERVICE] - Reschedule check for given host/service
lita: nagios ack(nowledge) <-h | --host HOST> [-s | --service SERVICE] [-m | --message MESSAGE] - Acknowledge host/service problem with optional message
lita: nagios (fixed|flexible) downtime <-d | --duration DURATION > <-h | --host HOST> [-s | --service SERVICE] - Schedule downtime for a host/service with duration units in (m, h, d, default to seconds)

License

MIT

lita-nagios's People

Contributors

josqu4red avatar

Watchers

James Cloos avatar Garfield Carneiro 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.