IcingaApi

This is an still experimental gem to access the Icinga Web REST API.

Installation

Add this line to your application's Gemfile:

gem 'icinga_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install icinga_api

Usage

create connection

require 'icinga_api'

icinga = IcingaApi.new(
  url: "http://icinga-server/icinga-web",
  authkey: "myauthkey"
)

some sample host API calls

host = icinga.host("my-monitored-host")

# is the host up?
host.up?

# what is the state of the host?
host.current_state

# when was the last check of the host
host.last_check

# has the host problem been acknowledged?
host.problem_has_been_acknowledged

# get a list of services of the host
host.services

# get a specific service by name on a host
service = host.service("Time")

etc.

some sample service API calls

# is the service ok?
service.ok?

# since when is the service in the current state?
service.last_state_change

# what is the display name of the service?
service.display_name

# when will the service be checked the next time?
service.next_check

etc.

Contributing

  1. Fork it ( https://github.com/terracor/icinga_api/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request