sensu-plugins-io-checks 1.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f4beb0429e8b5d472a8c56d3fd65890d03f559ce
4
- data.tar.gz: 79ddae3142604f5317d6aa461f63f58ae0c96263
2
+ SHA256:
3
+ metadata.gz: 97ac0f7b052f1b4a88c6ffef04e3dd9b2588be7bb01f6ee2bb1b64cc44d8fc7c
4
+ data.tar.gz: 6ebaf47455656a3c1c010ec03094f37a1355b9e222a2dad4ce09c5d8509966aa
5
5
  SHA512:
6
- metadata.gz: b75f2129c79d3ba96c8fe0baabd30ef830f8195dfc6e702a3405cd20621bbb2757ff27db7dab045bb42d90961eb847a61f0369d22bab3d230b1f4d56043baaf2
7
- data.tar.gz: b265784fafa66432e6c502eee5cea7fcec9031d146c1359292d63b3f46f3117550bccca824952ff55e890a744c661f392240721360fd4977ee4e02d205d9cef8
6
+ metadata.gz: d1ebb5c828d25771c04f62cf969ebda297dba79e9e1ae272c9d95b0a3c62fb94e1ee8399dbbd830bfb20e5698f2e9bd4ca94b49ecde47e3efbd6ce1f260bb766
7
+ data.tar.gz: 908cfd19a436497b103977ee679b71b9a6791f3da230ef92aff0cd520f7e04ae14229af1e684521f7c1568207e6c42ccbdfae39778a5b6fc121f9a8b77834996
@@ -1,10 +1,53 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [3.0.0] - 2020-06-01
9
+ ## Fixed
10
+ - Fix for incorrectfrozen Ruby literal string setting in plugin executables.
11
+
12
+ ## [3.0.0] - 2019-12-18
13
+ ### Breaking Changes
14
+ - Updated required minimum ruby version to 2.3
15
+
16
+ ### Changed
17
+ - Updated robocup development dependency to '~> 0.78.0'
18
+ - Updated rake development dependency to '~> 13.0'
19
+ - Updated bundler development dependancy to '~> 2.1'
20
+ - Updated codeclimate-test-reporter development dependancy to '~> 1.0'
21
+ - Updated yard development dependancy to '~> 0.9.20'
22
+ - Replaced codeclimate with simplecov to generate test coverage reports
23
+ - Updated bundler development depedency to '~> 2.1'
24
+ - Updated README to conform with standardization guidelines (sensu-plugins/community#134)
25
+
26
+ ### Added
27
+ - Added development dep on simplecov
28
+ - Updated asset build targets to support centos6
29
+
30
+ ## [2.0.0] - 2019-05-07
31
+ ### Breaking Changes
32
+ - Bump `sensu-plugin` dependency from `~> 1.2` to `~> 4.0` you can read the changelog entries for [4.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#400---2018-02-17), [3.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#300---2018-12-04), and [2.0](https://github.com/sensu-plugins/sensu-plugin/blob/master/CHANGELOG.md#v200---2017-03-29)
33
+
34
+ ### Changed
35
+ - Removed Ruby 2.0, 2.1, and 2.2 support
36
+
37
+ ### Added
38
+ - Travis build automation to generate Sensu Asset tarballs that can be used in conjunction with Sensu provided ruby runtime assets and the Bonsai Asset Index
39
+
40
+ ## [1.0.2] - 2018-10-27
41
+ ### Fixed
42
+ - metrics-iostat-extended.rb: Changes ouput in device session from 'Device:' to 'Device'. Fix issue #12 (@dmichelotto)
43
+
44
+ ### Added
45
+ - ruby 2.4 testing (@majormoses)
46
+
47
+ ## [1.0.1] - 2017-07-02
48
+ ### Fixed
49
+ - [ioping](https://github.com/koct9i/ioping) is switching to nanosecond precision - added 'ns' to metrics-ioping.rb (@MattMencel)
50
+
8
51
  ## [1.0.0] - 2016-06-20
9
52
  ### Added
10
53
  - rspec test cases for metrics-iostat-extended
@@ -33,7 +76,12 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
33
76
  ### Added
34
77
  - initial release
35
78
 
36
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/1.0.0...HEAD
79
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/3.0.1...HEAD
80
+ [3.0.1]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/3.0.0...3.0.1
81
+ [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/2.0.0...3.0.0
82
+ [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/1.0.2...2.0.0
83
+ [1.0.2]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/1.0.1...1.0.2
84
+ [1.0.1]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/1.0.0...1.0.1
37
85
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/0.0.3...1.0.0
38
86
  [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/0.0.2...0.0.3
39
87
  [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-io-checks/compare/0.0.1...0.0.2
data/README.md CHANGED
@@ -1,21 +1,148 @@
1
- ## Sensu-Plugins-io-checks
2
-
1
+ [![Sensu Bonsai Asset](https://img.shields.io/badge/Bonsai-Download%20Me-brightgreen.svg?colorB=89C967&logo=sensu)](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-io-checks)
3
2
  [ ![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-io-checks.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-io-checks)
4
3
  [![Gem Version](https://badge.fury.io/rb/sensu-plugins-io-checks.svg)](http://badge.fury.io/rb/sensu-plugins-io-checks)
5
4
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-io-checks/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-io-checks)
6
5
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-io-checks/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-io-checks)
7
6
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-io-checks.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-io-checks)
8
7
 
9
- ## Functionality
8
+ ## Sensu Plugins IO Checks Plugin
9
+
10
+ - [Overview](#overview)
11
+ - [Files](#files)
12
+ - [Usage examples](#usage-examples)
13
+ - [Configuration](#configuration)
14
+ - [Sensu Go](#sensu-go)
15
+ - [Asset registration](#asset-registration)
16
+ - [Asset definition](#asset-definition)
17
+ - [Check definition](#check-definition)
18
+ - [Sensu Core](#sensu-core)
19
+ - [Check definition](#check-definition)
20
+ - [Installation from source](#installation-from-source)
21
+ - [Additional notes](#additional-notes)
22
+ - [Contributing](#contributing)
23
+
24
+ ### Overview
25
+
26
+ This plugin provides native system I/O instrumentation for metrics collection via the system `ioping` utility.
27
+
28
+ ### Files
29
+ * bin/metrics-ioping.rb
30
+ * bin/metrics-iostat-extended.rb
31
+
32
+ **metrics-ioping**
33
+ Pushes `ioping` stats into Graphite.
34
+
35
+ **metrics-iostat-extended**
36
+ Collects iostat data for a specified disk or all disks. Output is in Graphite format.
37
+
38
+ ## Usage examples
39
+
40
+ ### Help
41
+
42
+ **metrics-ioping.rb**
43
+ ```
44
+ Usage: metrics-ioping.rb (options)
45
+ -C Use cached I/O
46
+ -c COUNT Stop after count requests
47
+ -d DEVICE|FILE|DIRECTORY Destination device, file or directory (required)
48
+ -D Use direct I/O
49
+ -i INTERVAL Interval between requests in seconds
50
+ -n NAME Name of the series (required)
51
+ -s, --scheme SCHEME Metric naming scheme, text to prepend to metric
52
+ ```
53
+
54
+ **metrics-iostat-extended.rb**
55
+ ```
56
+ Usage: metrics-iostat-extended.rb (options)
57
+ -d, --disk DISK Disk to gather stats for
58
+ -x, --exclude-disk DISK[,DISK] List of disks to exclude
59
+ -i, --interval SECONDS Period over which statistics are calculated (in seconds)
60
+ -N, --show-dm-names Display the registered device mapper names for any device mapper devices. Useful for viewing LVM2 statistics
61
+ --scheme SCHEME Metric naming scheme, text to prepend to .$parent.$child
62
+ ```
63
+
64
+ ## Configuration
65
+ ### Sensu Go
66
+ #### Asset registration
67
+
68
+ Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:
69
+
70
+ `sensuctl asset add sensu-plugins/sensu-plugins-io-checks`
71
+
72
+ If you're using an earlier version of sensuctl, you can download the asset definition from [this project's Bonsai asset index page](https://bonsai.sensu.io/assets/sensu-plugins/sensu-plugins-io-checks).
73
+
74
+ #### Asset definition
75
+
76
+ ```yaml
77
+ ---
78
+ type: Asset
79
+ api_version: core/v2
80
+ metadata:
81
+ name: sensu-plugins-io-checks
82
+ spec:
83
+ url: https://assets.bonsai.sensu.io/60e1713ecd4f0d2e38aada33b15d41580e716048/sensu-plugins-io-checks_2.0.0_centos_linux_amd64.tar.gz
84
+ sha512: de5f81305652edf93f459831a4a8d492207eb65120f28d249db7697c5dc1925e90d1483c6c46d70f3a48e530e62c1c3170d01c33b9e0d663081dffea52ff7bed
85
+ ```
86
+
87
+ #### Check definition
88
+
89
+ ```yaml
90
+ ---
91
+ type: CheckConfig
92
+ api_version: core/v2
93
+ metadata:
94
+ name: metrics-ioping
95
+ namespace: default
96
+ spec:
97
+ check_hooks: null
98
+ command: metrics-ioping.rb -exporter-url http://localhost:8080/metrics
99
+ output_metric_format: graphite
100
+ output_metric_handlers:
101
+ - graphite
102
+ runtime_assets:
103
+ - sensu/sensu-plugins-io-checks
104
+ - sensu/sensu-ruby-runtime
105
+ stdin: false
106
+ subdue: null
107
+ subscriptions:
108
+ - linux
109
+ timeout: 5
110
+ ttl: 0
111
+ ```
112
+
113
+ ### Sensu Core
114
+
115
+ #### Check definition
116
+ ```json
117
+ {
118
+ "checks": {
119
+ "metrics-ioping": {
120
+ "type": "metric",
121
+ "command": "metrics-ioping.rb -exporter-url http://localhost:8080/metrics",
122
+ "subscribers": ["app_tier"],
123
+ "interval": 10,
124
+ "handler": "graphite"
125
+ }
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## Installation from source
131
+
132
+ ### Sensu Go
133
+
134
+ See the instructions above for [asset registration](#asset-registration).
135
+
136
+ ### Sensu Core
137
+
138
+ Install and setup plugins on [Sensu Core](https://docs.sensu.io/sensu-core/latest/installation/installing-plugins/).
10
139
 
11
- ## Files
12
- * bin/metrics-ioping
13
- * bin/metrics-iostat-extended
140
+ ## Additional notes
14
141
 
15
- ## Usage
142
+ ### Sensu Go Ruby Runtime Assets
16
143
 
17
- ## Installation
144
+ The Sensu assets packaged from this repository are built against the Sensu Ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator, or handler), make sure to include the corresponding [Sensu Ruby Runtime Asset](https://bonsai.sensu.io/assets/sensu/sensu-ruby-runtime) in the list of assets needed by the resource.
18
145
 
19
- [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
146
+ ## Contributing
20
147
 
21
- ## Notes
148
+ See [CONTRIBUTING.md](https://github.com/sensu-plugins/sensu-plugins-io-checks/blob/master/CONTRIBUTING.md) for information about contributing to this plugin.
@@ -1,7 +1,8 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
2
+ # frozen_string_literal: false
3
+
3
4
  #
4
- # ioping-metrics
5
+ # metrics-ioping
5
6
  #
6
7
  # DESCRIPTION:
7
8
  # Push ioping stats into graphite
@@ -17,8 +18,11 @@
17
18
  # gem: socket
18
19
  #
19
20
  # USAGE:
21
+ # Collect IO metrics from /dev/sda
22
+ # metrics-ioping.rb -n sda -d /dev/sda
20
23
  #
21
24
  # NOTES:
25
+ # The ioping command must be installed
22
26
  #
23
27
  # LICENSE:
24
28
  # Copyright 2014 Mitsutoshi Aoe <maoe@foldr.in>
@@ -93,9 +97,10 @@ class IOPingMetrics < Sensu::Plugin::Metric::CLI::Graphite
93
97
  stats
94
98
  end
95
99
 
96
- NUMBER = /\d+(?:\.\d+)?/
97
- TIME_UNIT = /(?:us|ms|s|min|hour|day)/
100
+ NUMBER = /\d+(?:\.\d+)?/.freeze
101
+ TIME_UNIT = /(?:ns|us|ms|s|min|hour|day)/.freeze
98
102
  TIME_UNITS = {
103
+ 'ns' => 1e-9,
99
104
  'us' => 1e-6,
100
105
  'ms' => 1e-3,
101
106
  's' => 1,
@@ -104,7 +109,7 @@ class IOPingMetrics < Sensu::Plugin::Metric::CLI::Graphite
104
109
  'day' => 24 * 60 * 60
105
110
  }.freeze
106
111
  # #YELLOW
107
- STATS_HEADER = /min\/avg\/max\/mdev/
112
+ STATS_HEADER = /min\/avg\/max\/mdev/.freeze
108
113
 
109
114
  def parse_0_6(str)
110
115
  value = /#{NUMBER}/
@@ -1,7 +1,8 @@
1
1
  #! /usr/bin/env ruby
2
- # encoding: UTF-8
2
+ # frozen_string_literal: false
3
+
3
4
  #
4
- # iostat-extended-metrics
5
+ # metrics-iostat-extended
5
6
  #
6
7
  # DESCRIPTION:
7
8
  # This plugin collects iostat data for a specified disk or all disks.
@@ -19,8 +20,15 @@
19
20
  # gem: socket
20
21
  #
21
22
  # USAGE:
23
+ # Collect metrics for all disks
24
+ # metrics-iostat-extended.rb
25
+ #
26
+ # Collect metrics for /dev/sda for 3 seconds
27
+ # metrics-iostat-extended.rb -d /dev/sda -i 3
22
28
  #
23
29
  # NOTES:
30
+ # The iostat command must be installed. On Debian/Redhat systems
31
+ # iostat is part of the sysstat package.
24
32
  #
25
33
  # LICENSE:
26
34
  # Peter Fern <ruby@0xc0dedbad.com>
@@ -78,7 +86,7 @@ class IOStatExtended < Sensu::Plugin::Metric::CLI::Graphite
78
86
  headers = line.gsub(/%/, 'pct_').split(/\s+/)
79
87
  headers.shift
80
88
  next
81
- when /^(Device):/
89
+ when /^(Device):\s+.+/, /^(Device)\s+.+/
82
90
  stage = :device
83
91
  headers = line.gsub(/%/, 'pct_').split(/\s+/).map { |h| h.gsub(/\//, '_per_') }
84
92
  headers.shift
@@ -117,6 +125,7 @@ class IOStatExtended < Sensu::Plugin::Metric::CLI::Graphite
117
125
 
118
126
  stats.each do |disk, metrics|
119
127
  next if exclude_disk.include? disk
128
+
120
129
  metrics.each do |metric, value|
121
130
  output [config[:scheme], disk, metric].join('.'), value, timestamp
122
131
  end
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sensu-plugins-io-checks/version'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SensuPluginsIOChecks
2
4
  module Version
3
- MAJOR = 1
5
+ MAJOR = 3
4
6
  MINOR = 0
5
- PATCH = 0
7
+ PATCH = 1
6
8
 
7
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-io-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: '2.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.7'
40
+ version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: codeclimate-test-reporter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.4'
47
+ version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.4'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: github-markup
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '10.0'
89
+ version: '13.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '10.0'
96
+ version: '13.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: redcarpet
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -128,36 +128,50 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 0.40.0
131
+ version: 0.78.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 0.40.0
138
+ version: 0.78.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 0.13.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 0.13.0
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: yard
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - "~>"
144
158
  - !ruby/object:Gem::Version
145
- version: '0.8'
159
+ version: 0.9.20
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - "~>"
151
165
  - !ruby/object:Gem::Version
152
- version: '0.8'
166
+ version: 0.9.20
153
167
  description: |-
154
168
  This plugin provides native system I/O
155
169
  instrumentation for metrics collection via the
156
170
  system `ioping` utility.
157
171
  email: "<sensu-users@googlegroups.com>"
158
172
  executables:
159
- - metrics-ioping.rb
160
173
  - metrics-iostat-extended.rb
174
+ - metrics-ioping.rb
161
175
  extensions: []
162
176
  extra_rdoc_files: []
163
177
  files:
@@ -186,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
200
  requirements:
187
201
  - - ">="
188
202
  - !ruby/object:Gem::Version
189
- version: 2.0.0
203
+ version: 2.3.0
190
204
  required_rubygems_version: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - ">="
@@ -194,9 +208,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
208
  version: '0'
195
209
  requirements: []
196
210
  rubyforge_project:
197
- rubygems_version: 2.5.1
211
+ rubygems_version: 2.7.7
198
212
  signing_key:
199
213
  specification_version: 4
200
214
  summary: Sensu plugins for io checks
201
215
  test_files: []
202
- has_rdoc: