Sha256: 1321b394a07d6517f2af5ed368b74e85a8480b5d500099f99bc37a308a521f9e
Contents?: true
Size: 981 Bytes
Versions: 14
Compression:
Stored size: 981 Bytes
Contents
require 'dashing-contrib/bottles/nagios' module DashingContrib module Jobs module NagiosList extend DashingContrib::RunnableJob # Returns format # { # critical:[], # warning:[], # ok:[] # } def self.metrics(options) client = DashingContrib::Nagios::Client.new({ username: options[:username], endpoint: options[:endpoint], password: options[:password], version: options[:version] || 3, time_format: options[:time_format] || 'iso8601', verify_ssl: options[:verify_ssl] || true, }) client.status(options[:nagios_filter] || {}) end def self.validate_state(metrics, options = {}) return DashingContrib::RunnableJob::CRITICAL unless metrics[:critical].size.zero? return DashingContrib::RunnableJob::WARNING unless metrics[:warning].size.zero? DashingContrib::RunnableJob::OK end end end end
Version data entries
14 entries across 14 versions & 1 rubygems