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 +4 -4
- data/CHANGELOG.md +19 -1
- data/README.md +0 -3
- data/bin/check-windows-cpu-load.rb +2 -0
- data/bin/check-windows-disk.rb +3 -1
- data/bin/check-windows-process.rb +4 -1
- data/bin/check-windows-processor-queue-length.rb +2 -0
- data/bin/check-windows-ram.rb +8 -6
- data/bin/check-windows-service.rb +2 -0
- data/bin/metric-windows-cpu-load.rb +2 -0
- data/bin/metric-windows-disk-usage.rb +2 -0
- data/bin/metric-windows-network.rb +2 -0
- data/bin/metric-windows-processor-queue-length.rb +2 -0
- data/bin/metric-windows-ram-usage.rb +8 -6
- data/bin/metric-windows-uptime.rb +2 -0
- data/bin/powershell_helper.rb +2 -0
- data/lib/sensu-plugins-windows.rb +2 -0
- data/lib/sensu-plugins-windows/version.rb +5 -3
- metadata +16 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0c7150e6899ce9261e5042c957d3b741bb80808082da47a1a82ea5a7262f317
|
4
|
+
data.tar.gz: 41edf909b04148f7b2fd80764205446782ab6955b19f4a73d1aa3e10ed62571d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6400355203e893abb4a723c68236929235c1042c2ffa2a5625047564d1bd75e47a15c9bd4fc0dc4d8401946fe0a57bfa9d577d37bc86aa8e0c6ca5371a565bb7
|
7
|
+
data.tar.gz: 44d32ff57d25ce56ed3ed136573bc5d9ad291b8ddc42324afabb8b766af4d7ef6eed1fa61c8b285696bc86449ff19d3fcfc0835facebb9ab327e558f523838d9
|
data/CHANGELOG.md
CHANGED
@@ -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/
|
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
|
[](https://travis-ci.org/sensu-plugins/sensu-plugins-windows)
|
4
4
|
[](http://badge.fury.io/rb/sensu-plugins-windows)
|
5
|
-
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows)
|
6
|
-
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-windows)
|
7
|
-
[](https://gemnasium.com/sensu-plugins/sensu-plugins-windows)
|
8
5
|
[](https://ci.appveyor.com/project/majormoses/sensu-plugins-windows/branch/master)
|
9
6
|
[](https://slack.sensu.io/badge)
|
10
7
|
|
data/bin/check-windows-disk.rb
CHANGED
@@ -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."
|
data/bin/check-windows-ram.rb
CHANGED
@@ -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
|
-
|
42
|
-
|
43
|
-
IO.popen('typeperf -sc 1 "Memory\\Available bytes" ') { |io| io.each { |line|
|
44
|
-
temp =
|
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|
|
47
|
-
total_ram =
|
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
|
# 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
|
-
|
40
|
-
|
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|
|
43
|
-
temp =
|
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|
|
46
|
-
total_ram =
|
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]
|
data/bin/powershell_helper.rb
CHANGED
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:
|
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-
|
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: '
|
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: '
|
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: '
|
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: '
|
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:
|
98
|
+
name: rspec
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
101
|
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
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:
|
110
|
+
version: '3.1'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
112
|
+
name: rubocop
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
115
|
- - "~>"
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
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:
|
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:
|
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:
|
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.
|
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.
|
229
|
+
rubygems_version: 3.0.3
|
244
230
|
signing_key:
|
245
231
|
specification_version: 4
|
246
232
|
summary: Sensu plugins for Windows
|