sensu-plugins-windows 2.9.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2bfbb56ce43e0bf6b112818c767c74c1c3a8d68dfca72e7f7dd258e59353919
4
- data.tar.gz: dc1174d59888c3bcf4e2a4fca1b71508a52f81b3bc5c52eb9cbcc3974d07769d
3
+ metadata.gz: d0c7150e6899ce9261e5042c957d3b741bb80808082da47a1a82ea5a7262f317
4
+ data.tar.gz: 41edf909b04148f7b2fd80764205446782ab6955b19f4a73d1aa3e10ed62571d
5
5
  SHA512:
6
- metadata.gz: 1e7a3864e5cba534c79db66510f24338c492d34051e272d2f1115b0bc488c14c84d6a9cc5b89f1e33321c82b3e20196a657d80a8eaf3c97d26bfe72d5b81b780
7
- data.tar.gz: 01d70f434a23454f4575ec99ae94351a2b4d3c354d12b3ae4704b08bf23f7687df3436662e514af20aa5c14de3a6b84c592e32b413133e0a5b4a9d002d281543
6
+ metadata.gz: 6400355203e893abb4a723c68236929235c1042c2ffa2a5625047564d1bd75e47a15c9bd4fc0dc4d8401946fe0a57bfa9d577d37bc86aa8e0c6ca5371a565bb7
7
+ data.tar.gz: 44d32ff57d25ce56ed3ed136573bc5d9ad291b8ddc42324afabb8b766af4d7ef6eed1fa61c8b285696bc86449ff19d3fcfc0835facebb9ab327e558f523838d9
@@ -6,6 +6,23 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+
10
+ ## [3.0.0] - 2019-03-04
11
+ ### Security
12
+ - updated yard dependency to `~> 0.9.11` per: https://nvd.nist.gov/vuln/detail/CVE-2017-17042 (@majormoses)
13
+ - updated rubocop dependency to `~> 0.51.0` per: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8418. (@majormoses)
14
+
15
+ ### Breaking Changes
16
+ - drop EOL rubies `< 2.3` (@majormoses)
17
+ - 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) (@majormoses)
18
+
19
+ ### Changed
20
+ - update `bundler` dependency (@majormoses)
21
+ - appeased the cops (@majormoses)
22
+
23
+ ### Removed
24
+ - `codeclimate` (@majormoses)
25
+
9
26
  ## [2.9.1] - 2019-02-17
10
27
  ### Fixed
11
28
  - check-windows-disk.rb: use the full path for CSV file path due to a bug in `wmic` (@jasiek191)
@@ -190,7 +207,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
190
207
  ### Added
191
208
  - Initial release
192
209
 
193
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.9.1...HEAD
210
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/3.0.0...HEAD
211
+ [3.0.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.9.1...3.0.0
194
212
  [2.9.1]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.9.0...2.9.1
195
213
  [2.9.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.8.1...2.9.0
196
214
  [2.8.1]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.8.0...2.8.1
data/README.md CHANGED
@@ -2,9 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-windows.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-windows)
4
4
  [![Gem Version](https://badge.fury.io/rb/sensu-plugins-windows.svg)](http://badge.fury.io/rb/sensu-plugins-windows)
5
- [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows)
6
- [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows)
7
- [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-windows.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-windows)
8
5
  [![Appveyor status](https://ci.appveyor.com/api/projects/status/j6cg9tmxs6ivscrd/branch/master?svg=true)](https://ci.appveyor.com/project/majormoses/sensu-plugins-windows/branch/master)
9
6
  [![Community Slack](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/badge)
10
7
 
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-cpu-load.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-disk.rb
4
6
  #
@@ -79,7 +81,7 @@ class CheckDisk < Sensu::Plugin::Check::CLI
79
81
  next if config[:ignoretype] && config[:ignoretype].include?(type)
80
82
  next if config[:ignoremnt] && config[:ignoremnt].include?(mnt)
81
83
  next if config[:ignorelabel] && config[:ignorelabel].match(label)
82
- rescue
84
+ rescue StandardError
83
85
  unknown "malformed line from df: #{line}"
84
86
  end
85
87
  # If label value is not set, the drive letter will end up in that column. Set mnt to label in that case.
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-process.rb
4
6
  #
@@ -27,6 +29,7 @@
27
29
  require 'optparse'
28
30
  require 'time'
29
31
  require 'win32ole'
32
+ require 'date'
30
33
 
31
34
  options = {}
32
35
  parser = OptionParser.new do |opts|
@@ -70,7 +73,7 @@ status = 2
70
73
  wmi.ExecQuery('select * from win32_process').each do |process|
71
74
  next unless process.Name.downcase.include? options[:procname].downcase
72
75
  if !options[:warn].nil?
73
- delta_days = DateTime.now - DateTime.parse(process.CreationDate)
76
+ delta_days = DateTime.now - DateTime.parse(process.CreationDate) # rubocop:disable Style/DateTime
74
77
  delta_secs = (delta_days * 24 * 60 * 60).to_i
75
78
  if delta_secs > options[:warn]
76
79
  puts "OK: #{process.Name} running more than #{options[:warn]} seconds."
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-processor-queue-length.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-ram.rb
4
6
  #
@@ -38,13 +40,13 @@ class CheckWindowsRAMLoad < Sensu::Plugin::Check::CLI
38
40
  proc: proc(&:to_i)
39
41
 
40
42
  def acquire_ram_usage
41
- temp_arr_1 = []
42
- temp_arr_2 = []
43
- IO.popen('typeperf -sc 1 "Memory\\Available bytes" ') { |io| io.each { |line| temp_arr_1.push(line) } }
44
- temp = temp_arr_1[2].split(',')[1]
43
+ temp_arr1 = []
44
+ temp_arr2 = []
45
+ IO.popen('typeperf -sc 1 "Memory\\Available bytes" ') { |io| io.each { |line| temp_arr1.push(line) } }
46
+ temp = temp_arr1[2].split(',')[1]
45
47
  ram_available_in_bytes = temp[1, temp.length - 3].to_f
46
- IO.popen('wmic OS get TotalVisibleMemorySize /Value') { |io| io.each { |line| temp_arr_2.push(line) } }
47
- total_ram = temp_arr_2[4].split('=')[1].to_f
48
+ IO.popen('wmic OS get TotalVisibleMemorySize /Value') { |io| io.each { |line| temp_arr2.push(line) } }
49
+ total_ram = temp_arr2[4].split('=')[1].to_f
48
50
  total_ram_in_bytes = total_ram * 1000.0
49
51
  ram_use_percent = (total_ram_in_bytes - ram_available_in_bytes) * 100.0 / total_ram_in_bytes
50
52
  ram_use_percent.round(2)
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # check-windows-service.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-cpu-load.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-disk-usage.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-network.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-processor-queue-length.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-ram-usage.rb
4
6
  #
@@ -36,14 +38,14 @@ class RamMetric < Sensu::Plugin::Metric::CLI::Graphite
36
38
  default: Socket.gethostname.to_s
37
39
 
38
40
  def acquire_ram_usage
39
- temp_arr_1 = []
40
- temp_arr_2 = []
41
+ temp_arr1 = []
42
+ temp_arr2 = []
41
43
  timestamp = Time.now.utc.to_i
42
- IO.popen('typeperf -sc 1 "Memory\\Available bytes" ') { |io| io.each { |line| temp_arr_1.push(line) } }
43
- temp = temp_arr_1[2].split(',')[1]
44
+ IO.popen('typeperf -sc 1 "Memory\\Available bytes" ') { |io| io.each { |line| temp_arr1.push(line) } }
45
+ temp = temp_arr1[2].split(',')[1]
44
46
  ram_available_in_bytes = temp[1, temp.length - 3].to_f
45
- IO.popen('wmic OS get TotalVisibleMemorySize /Value') { |io| io.each { |line| temp_arr_2.push(line) } }
46
- total_ram = temp_arr_2[4].split('=')[1].to_f
47
+ IO.popen('wmic OS get TotalVisibleMemorySize /Value') { |io| io.each { |line| temp_arr2.push(line) } }
48
+ total_ram = temp_arr2[4].split('=')[1].to_f
47
49
  total_ram_in_bytes = total_ram * 1000.0
48
50
  ram_use_percent = (total_ram_in_bytes - ram_available_in_bytes) * 100.0 / total_ram_in_bytes
49
51
  [ram_use_percent.round(2), timestamp]
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # metric-windows-uptime.rb
4
6
  #
@@ -1,4 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: false
3
+
2
4
  #
3
5
  # powershell_helper.rb
4
6
  #
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sensu-plugins-windows/version'
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module SensuPluginsWindows
2
4
  module Version
3
- MAJOR = 2
4
- MINOR = 9
5
- PATCH = 1
5
+ MAJOR = 3
6
+ MINOR = 0
7
+ PATCH = 0
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-windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.1
4
+ version: 3.0.0
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: 2019-02-18 00:00:00.000000000 Z
11
+ date: 2019-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -16,42 +16,28 @@ 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.0'
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'
41
- - !ruby/object:Gem::Dependency
42
- name: codeclimate-test-reporter
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.4'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.4'
40
+ version: '2.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: github-markup
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -109,47 +95,47 @@ dependencies:
109
95
  - !ruby/object:Gem::Version
110
96
  version: '3.2'
111
97
  - !ruby/object:Gem::Dependency
112
- name: rubocop
98
+ name: rspec
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: 0.40.0
103
+ version: '3.1'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: 0.40.0
110
+ version: '3.1'
125
111
  - !ruby/object:Gem::Dependency
126
- name: rspec
112
+ name: rubocop
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - "~>"
130
116
  - !ruby/object:Gem::Version
131
- version: '3.1'
117
+ version: 0.51.0
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: '3.1'
124
+ version: 0.51.0
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: yard
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
129
  - - "~>"
144
130
  - !ruby/object:Gem::Version
145
- version: '0.8'
131
+ version: 0.9.11
146
132
  type: :development
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - "~>"
151
137
  - !ruby/object:Gem::Version
152
- version: '0.8'
138
+ version: 0.9.11
153
139
  description: Sensu plugins for Windows
154
140
  email: "<sensu-users@googlegroups.com>"
155
141
  executables:
@@ -233,14 +219,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
233
219
  requirements:
234
220
  - - ">="
235
221
  - !ruby/object:Gem::Version
236
- version: 2.0.0
222
+ version: 2.3.0
237
223
  required_rubygems_version: !ruby/object:Gem::Requirement
238
224
  requirements:
239
225
  - - ">="
240
226
  - !ruby/object:Gem::Version
241
227
  version: '0'
242
228
  requirements: []
243
- rubygems_version: 3.0.2
229
+ rubygems_version: 3.0.3
244
230
  signing_key:
245
231
  specification_version: 4
246
232
  summary: Sensu plugins for Windows