Giter Site home page Giter Site logo

icinga_result's Introduction

Icinga Result Client

This gem provides a library and executable to send passive check results via API to Icinga2.

Installation

Require it in your Gemfile

gem 'icinga_result'

or install it directly via

gem install icinga_result

Configuration

To use the gem you need a configuration file with an Icinga API host and user.

---
username: your icinga username
password: your super secred icinga password
host: icinga.example.com
port: 5665
always_send_host_alive: false

"always_send_host_alive" sends the host alive signal every time a service result is delivered.

Usage

Command line client

You can deliver status results simple by calling icinga-result. While it is sufficient to supply "name", "status" and "message" when the service exists, you should probably always give as much information as you can. The first time a check result is sent, it will probably fail (since the service does not exist yet). But it will automatically be created and when the check is run a second time, the result will be sent.

$ icinga-result --help
Usage: --help [options]
        --service [NAME]             Service name
        --interval [INTERVAL]        Server check interval
        --description [DESCRIPTION]  Service description
        --status [STATUS]            Status code for the check
        --message [MESSAGE]          Status message for the check
        --performance-data [DATA]    Performance data for the check
        --host-alive                 Send host alive signal

Library

When you implement your check in Ruby, you can call the library directly. A simple script might look like this:

require 'icinga_result/client'

client = IcingaResult::Client.new
service = IcingaResult::Service.new('demo', interval: 3600, description: 'This is a demo check')

if my_special_check
  result = IcingaResult::CheckResult.new(0, 'Ok')
else
  result = IcingaResult::CheckResult.new(2, 'Special is borken!')
end

client.send(service, result)

icinga_result's People

Contributors

kayssun avatar

Watchers

 avatar  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.