Module: Htmon::Icinga
- Defined in:
- lib/htmon/icinga.rb,
lib/htmon/icinga/module.rb,
lib/htmon/icinga/version.rb,
lib/htmon/icinga/modules/load.rb,
lib/htmon/icinga/modules/process.rb,
lib/htmon/icinga/modules/packages.rb,
lib/htmon/icinga/modules/keepalive.rb
Defined Under Namespace
Classes: Module
Constant Summary collapse
- VERSION =
"0.3.3"
Class Method Summary collapse
- .new(hostname: nil, metric: nil, thresh: nil, warn: nil, redis: nil) ⇒ Object
- .redis ⇒ Object
- .redis=(r) ⇒ Object
Class Method Details
.new(hostname: nil, metric: nil, thresh: nil, warn: nil, redis: nil) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/htmon/icinga/module.rb', line 5 def self.new hostname: nil, metric: nil, thresh: nil, warn: nil, redis: nil a = Module.modules.find do |x| x.metric_name.to_s == metric.to_s[/^[^:]+/] end if a a.new(hostname: hostname, thresh: thresh, warn: warn, redis: redis, metric: metric) else raise "No module found" end end |
.redis ⇒ Object
9 10 11 |
# File 'lib/htmon/icinga.rb', line 9 def self.redis @redis end |
.redis=(r) ⇒ Object
13 14 15 |
# File 'lib/htmon/icinga.rb', line 13 def self.redis= r @redis = r end |