From 89331b1ab1c41db0d44388aa45b4daea94d148cc Mon Sep 17 00:00:00 2001 From: Matt Jones Date: Mon, 2 Mar 2015 08:29:53 -0500 Subject: [PATCH] clean repo --- .gitignore | 18 +++++++ .rubocop.yml | 25 ++++++++++ .travis.yml | 18 +++++++ README.md | 48 +++++++++++++++---- Rakefile | 8 ---- bin/{check-data.rb => check-graphite-data.rb} | 0 ...ation.rb => check-graphite-replication.rb} | 0 ...check-stats.rb => check-graphite-stats.rb} | 0 bin/{graphite.rb => check-graphite.rb} | 0 ...{graphite_ext.rb => extension-graphite.rb} | 0 bin/graphite-occurrences.json | 6 --- bin/graphite-tcp.rb | 8 ---- bin/graphite_event.json | 9 ---- ...ite_event.rb => handler-graphite-event.rb} | 0 ...e_notify.rb => handler-graphite-notify.rb} | 0 ...ces.rb => handler-graphite-occurrences.rb} | 0 bin/{graphite_mut.rb => mutator-graphite.rb} | 0 sensu-plugins-graphite.gemspec | 28 ++++------- 18 files changed, 108 insertions(+), 60 deletions(-) create mode 100644 .gitignore create mode 100644 .rubocop.yml create mode 100644 .travis.yml rename bin/{check-data.rb => check-graphite-data.rb} (100%) rename bin/{check-replication.rb => check-graphite-replication.rb} (100%) rename bin/{check-stats.rb => check-graphite-stats.rb} (100%) rename bin/{graphite.rb => check-graphite.rb} (100%) rename bin/{graphite_ext.rb => extension-graphite.rb} (100%) delete mode 100644 bin/graphite-occurrences.json delete mode 100755 bin/graphite-tcp.rb delete mode 100644 bin/graphite_event.json rename bin/{graphite_event.rb => handler-graphite-event.rb} (100%) rename bin/{graphite_notify.rb => handler-graphite-notify.rb} (100%) rename bin/{graphite-occurrences.rb => handler-graphite-occurrences.rb} (100%) rename bin/{graphite_mut.rb => mutator-graphite.rb} (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f92e714 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ +*.bundle +*.so +*.o +*.a +mkmf.log +.vagrant/* +.DS_Store +.idea/* +*.gem diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..8011955 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,25 @@ + +MethodLength: + Max: 200 + +LineLength: + Max: 160 + +FileName: + Enabled: false + +PerceivedComplexity: + Enabled: false + +CyclomaticComplexity: + Enabled: false + +ClassLength: + Enabled: false + +IfUnlessModifier: + Enabled: false + +RegexpLiteral: + Enabled: false + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..95ba777 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: ruby +cache: + - bundler +install: + - bundle install +rvm: + - 1.9.3 + - 2.0 + - 2.1 +notifications: + email: + recipients: + - mattjones@yieldbot.com + on_success: change + on_failure: always + +script: + - 'bundle exec rake default' diff --git a/README.md b/README.md index b8bcd07..681440a 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,49 @@ -## Sensu-Plugins-disk-checks +## Sensu-Plugins-graphite -[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-graphite.svg?branch=master)][1] -[![Gem Version](https://badge.fury.io/rb/sensu-plugins-graphite.svg)][2] -[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite/badges/gpa.svg)][3] -[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite/badges/coverage.svg)][4] -[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-graphite.svg)][5] +[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-graphite.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-graphite) +[![Gem Version](https://badge.fury.io/rb/sensu-plugins-graphite.svg)](http://badge.fury.io/rb/sensu-plugins-graphite) +[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite) +[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-graphite) +[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-graphite.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-graphite) ## Functionality ## Files - * - * - * - * + * bin/check-graphite-data + * bin/check-graphite-replication + * bin/check-graphite-stats + * bin/check-graphite + * bin/extension-graphite + * bin/handlr-graphite-event + * bin/hanlder-graphite-notify + * bin/handler-graphite-occurances + * bin/mutator-graphite ## Usage +**handler-graphite-event** +``` +{ + "graphite_event": { + "server_uri": "https://graphite.example.com:443/events/", + "tags": [ + "custom_tag_a", + "custom_tag_b" + ] + } +} +``` + +**handler-graphite-occurances** +``` +{ + "graphite": { + "server":"graphite.example.com", + "port":"2003" + } +} +``` + ## Installation Add the public key (if you haven’t already) as a trusted certificate diff --git a/Rakefile b/Rakefile index 4e5d83a..c4ee4f2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,19 +1,11 @@ - require 'bundler/gem_tasks' - require 'rspec/core/rake_task' - require 'yard' - require 'github/markup' - require 'rubocop/rake_task' - require 'redcarpet' - require 'yard/rake/yardoc_task' - desc 'Don\'t run Rubocop for unsupported versions' begin if RUBY_VERSION >= '2.0.0' diff --git a/bin/check-data.rb b/bin/check-graphite-data.rb similarity index 100% rename from bin/check-data.rb rename to bin/check-graphite-data.rb diff --git a/bin/check-replication.rb b/bin/check-graphite-replication.rb similarity index 100% rename from bin/check-replication.rb rename to bin/check-graphite-replication.rb diff --git a/bin/check-stats.rb b/bin/check-graphite-stats.rb similarity index 100% rename from bin/check-stats.rb rename to bin/check-graphite-stats.rb diff --git a/bin/graphite.rb b/bin/check-graphite.rb similarity index 100% rename from bin/graphite.rb rename to bin/check-graphite.rb diff --git a/bin/graphite_ext.rb b/bin/extension-graphite.rb similarity index 100% rename from bin/graphite_ext.rb rename to bin/extension-graphite.rb diff --git a/bin/graphite-occurrences.json b/bin/graphite-occurrences.json deleted file mode 100644 index b477da2..0000000 --- a/bin/graphite-occurrences.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "graphite": { - "server":"graphite.example.com", - "port":"2003" - } -} diff --git a/bin/graphite-tcp.rb b/bin/graphite-tcp.rb deleted file mode 100755 index a941e64..0000000 --- a/bin/graphite-tcp.rb +++ /dev/null @@ -1,8 +0,0 @@ -# This handler has been deprecated in favor of using a TCP handler. -# Performance is much better anyway. You'll love it. -# -# http://docs.sensuapp.org/0.9/handlers.html -# -# Example: -# -# https://github.com/portertech/demo_stack/blob/master/chef/data_bags/sensu/config.json#L18 diff --git a/bin/graphite_event.json b/bin/graphite_event.json deleted file mode 100644 index 693fc58..0000000 --- a/bin/graphite_event.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "graphite_event": { - "server_uri": "https://graphite.example.com:443/events/", - "tags": [ - "custom_tag_a", - "custom_tag_b" - ] - } -} diff --git a/bin/graphite_event.rb b/bin/handler-graphite-event.rb similarity index 100% rename from bin/graphite_event.rb rename to bin/handler-graphite-event.rb diff --git a/bin/graphite_notify.rb b/bin/handler-graphite-notify.rb similarity index 100% rename from bin/graphite_notify.rb rename to bin/handler-graphite-notify.rb diff --git a/bin/graphite-occurrences.rb b/bin/handler-graphite-occurrences.rb similarity index 100% rename from bin/graphite-occurrences.rb rename to bin/handler-graphite-occurrences.rb diff --git a/bin/graphite_mut.rb b/bin/mutator-graphite.rb similarity index 100% rename from bin/graphite_mut.rb rename to bin/mutator-graphite.rb diff --git a/sensu-plugins-graphite.gemspec b/sensu-plugins-graphite.gemspec index 38a884a..da993e7 100644 --- a/sensu-plugins-graphite.gemspec +++ b/sensu-plugins-graphite.gemspec @@ -31,23 +31,13 @@ Gem::Specification.new do |s| s.platform = ruby s.required_ruby_version = '>= 1.9.3' - - s.add_development_dependency 'codeclimate-test-reporter' 'XXX' - - s.add_development_dependency 'rubocop' '~> 0.17.0' - - s.add_development_dependency 'rspec' '~> 3.1' - - s.add_development_dependency 'bundler' '~> 1.7' - - s.add_development_dependency 'rake' '~> 10.0' - - s.add_development_dependency 'github-markup' 'XXX' - - s.add_development_dependency 'redcarpet' 'XXX' - - s.add_development_dependency 'yard' 'XXX' - - s.add_development_dependency 'pry' 'XXX' - + s.add_development_dependency 'codeclimate-test-reporter' + s.add_development_dependency 'rubocop', '~> 0.17.0' + s.add_development_dependency 'rspec', '~> 3.1' + s.add_development_dependency 'bundler', '~> 1.7' + s.add_development_dependency 'rake', '~> 10.0' + s.add_development_dependency 'github-markup' + s.add_development_dependency 'redcarpet' + s.add_development_dependency 'yard' + s.add_development_dependency 'pry' end