From f801bc7516ae03ae718ae39ddc3d8e3d5ca0f3e1 Mon Sep 17 00:00:00 2001 From: Jing Dong Date: Tue, 17 Jun 2014 11:22:46 +0100 Subject: [PATCH 1/2] allow to filter optionally by hostgroup --- README.md | 7 ++++++- lib/nagiosharder.rb | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae06a0a..e99ce7a 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,14 @@ Or just muted services, sorted desc by duration: :sort_option => :state_duration, ) -Or get the details for a single service group: +Or get the details for a single service group, default is 'all': site.service_status(:group => "AWESOME") + +Or filter details for hostgroup, default is 'all': + + site.service_status(:hostgroup => "apiservices") + Schedule a host to have services checks run again right now: diff --git a/lib/nagiosharder.rb b/lib/nagiosharder.rb index 6f91927..0b1c8f3 100644 --- a/lib/nagiosharder.rb +++ b/lib/nagiosharder.rb @@ -246,6 +246,7 @@ def service_status(options = {}) if @version == 3 params['servicegroup'] = options[:group] || 'all' + params['hostgroup'] = options[:hostgroup] || 'all' params['style'] = 'detail' params['embedded'] = '1' params['noheader'] = '1' @@ -254,6 +255,9 @@ def service_status(options = {}) if options[:group] params['servicegroup'] = options[:group] params['style'] = 'detail' + elsif options[:hostgroup] + params[:hostgroup] = options[:hostgroup] + params['style'] = 'detail' else params['host'] = 'all' end From 5d04d9c12c10f1e67118189dfe948bfa8c793976 Mon Sep 17 00:00:00 2001 From: Jing Dong Date: Tue, 17 Jun 2014 11:33:37 +0100 Subject: [PATCH 2/2] update version to 0.5.1 --- nagiosharder.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nagiosharder.gemspec b/nagiosharder.gemspec index d446692..c1ab08c 100644 --- a/nagiosharder.gemspec +++ b/nagiosharder.gemspec @@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__) Gem::Specification.new do |s| s.name = 'nagiosharder' - s.version = '0.5.0' + s.version = '0.5.1' s.date = Time.now.strftime('%Y-%m-%d') s.platform = Gem::Platform::RUBY s.authors = ['Josh Nichols', 'Jesse Newland', 'Travis Graham']