sensu-plugins-windows 2.8.1 → 2.9.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: fd3a4098e6f25922041cfc0088356532f8fd9ec82d4956339eb965589bdd302d
4
- data.tar.gz: 4d2456754b19b5a0b43bc678238a35a814d1a1679b09ef8bd10aadaf85387c7a
3
+ metadata.gz: adcb0319e5807db3f461dfb2d5d0d2e3a12ab7c5c87e000ab86c7b75728f8248
4
+ data.tar.gz: 84f210f1f03cfa80fa4d5cf8f17150a6828d110a2929cb74b8ed17a1a8cba504
5
5
  SHA512:
6
- metadata.gz: f7d43a06188becca9a6c78dc8b8fe97f851315f420c96061eda6b0c56c307242ba88ed27c1d096dda203594179fa38041f415fa23fe4014a5e973bdeffd47e0c
7
- data.tar.gz: 26923d79d21852022ec4cd939aa5178180c8d37e76d6510a71829219dafe1e34e554a2df6813d36219f26b84fc58f9a9f8a13c6d995b38303f6bda170c1641f9
6
+ metadata.gz: 9a59082ffe848d32660c3b92e156a4b6f819b6ef8f960d08135723bc11a177e13dcdcf8269b0e22f8dbbaa94ea00468b2ec62399e82995421df49a66ac2f696a
7
+ data.tar.gz: c028b3249a15a4b684b9ad5d5797755d0bd5ad126896983e9d22e6f4f3a8b1d5b5d29e11b4df908ed537de0630cedb2ca0d92570bf4ed4c92f3046d3abd2a256
@@ -5,6 +5,21 @@ This CHANGELOG follows the format listed at [Our CHANGELOG Guidelines ](https://
5
5
  Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
+ ## [2.9.0] - 2018-08-24
9
+ ### Changed
10
+ - updated check: `powershell/check-windows-disk-writeable.ps1` now using CIM instead of WMI for large performance gain (@csabo)
11
+ - updated check: `powershell/check-windows-disk.ps1` now using CIM instead of WMI for large performance gain (@csabo)
12
+ - updated check: `powershell/check-windows-pagefile.ps1` now using CIM instead of WMI for large performance gain (@csabo)
13
+ - updated check: `powershell/check-windows-processor-queue-length.ps1` now using CIM instead of WMI for large performance gain (@csabo)
14
+ - updated check: `powershell/check-windows-ram.ps1` now using CIM instead of WMI for large performance gain (@csabo)
15
+ - updated check: `powershell/metric-windows-disk-usage.ps1` now using CIM instead of WMI for large performance gain (@csabo)
16
+ - updated check: `powershell/metric-windows-processor-queue-length.ps1` now using CIM instead of WMI for large performance gain (@csabo)
17
+ - updated check: `powershell/metric-windows-ram-usage.ps1` now using CIM instead of WMI for large performance gain (@csabo)
18
+
19
+
20
+
21
+ ### Added
22
+ - README.md, added troubleshooting section with fix for corrupt performance counters [issue #35](https://github.com/sensu-plugins/sensu-plugins-windows/issues/35) (@csabo)
8
23
 
9
24
  ## [2.8.1] - 2018-07-19
10
25
  ### Fixed
@@ -170,7 +185,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
170
185
  ### Added
171
186
  - Initial release
172
187
 
173
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.8.1...HEAD
188
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.9.0...HEAD
189
+ [2.9.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.8.1...2.9.0
174
190
  [2.8.1]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.8.0...2.8.1
175
191
  [2.8.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.7.0...2.8.0
176
192
  [2.7.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.6.0...2.7.0
data/README.md CHANGED
@@ -110,6 +110,11 @@ You should also include the full escaped path to the ruby interpreter in the che
110
110
  ## Dependencies
111
111
  * Powershell checks require Powershell version 3.0 or higher.
112
112
 
113
+ ## Troubleshooting
114
+ * Failures to pull counter data with messages like below, might be due to corrupt performance counters. See [Here](https://support.microsoft.com/en-us/help/2554336/how-to-manually-rebuild-performance-counters-for-windows-server-2008-6) for more information. Short answer on fix is `lodctr /R` in an Admin elevated command prompt
115
+
116
+ `Check failed to run: undefined method length' for nil:NilClass, "c:/opt/sensu/plugins/check-windows-ram.rb:45:inacquire_ram_usage'", "c:/opt/sensu/plugins/check-windows-ram.rb:54:in run'", "c:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.`
117
+
113
118
  ## Installation
114
119
 
115
120
  [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
@@ -51,7 +51,7 @@ $critDisks = ""
51
51
 
52
52
  $AllDisks = @()
53
53
  Foreach ($DT in $($DriveType -split(','))) {
54
- Get-WMIObject Win32_LogicalDisk -Filter "DriveType = ${DT}" | Where-Object{ $_.DeviceID -notmatch "[$($Ignore.Replace(',',''))]:"} | %{ $AllDisks += $_ }
54
+ Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DriveType = ${DT}" | Where-Object { $_.DeviceID -notmatch "[$($Ignore.Replace(',',''))]:"} | %{ $AllDisks += $_ }
55
55
  }
56
56
 
57
57
  if ($AllDisks.count -eq 0) {
@@ -45,7 +45,7 @@ If ($IGNORE -eq "") {
45
45
  $IGNORE = "ab"
46
46
  }
47
47
 
48
- $AllDisks = Get-WMIObject Win32_LogicalDisk -Filter "DriveType = 3" | Where-Object{ $_.DeviceID -notmatch "[$IGNORE]:"}
48
+ $AllDisks = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DriveType = 3" | Where-Object { $_.DeviceID -notmatch "[$IGNORE]:"}
49
49
 
50
50
  $crit = 0
51
51
  $warn = 0
@@ -37,8 +37,8 @@ Param(
37
37
  $ThisProcess = Get-Process -Id $pid
38
38
  $ThisProcess.PriorityClass = "BelowNormal"
39
39
 
40
- [int]$pagefileAllocated = Get-WmiObject -Class Win32_PageFileUsage | Select -ExpandProperty AllocatedBaseSize
41
- [int]$pagefileCurrentUsage = Get-WmiObject -Class Win32_PageFileUsage | Select -ExpandProperty CurrentUsage
40
+ [int]$pagefileAllocated = (Get-CimInstance -classname Win32_PageFileUsage).AllocatedBaseSize
41
+ [int]$pagefileCurrentUsage = (Get-CimInstance -classname Win32_PageFileUsage).CurrentUsage
42
42
 
43
43
  [int]$Value = ($pagefileCurrentUsage/$pagefileAllocated) * 100
44
44
 
@@ -37,7 +37,7 @@ Param(
37
37
  $ThisProcess = Get-Process -Id $pid
38
38
  $ThisProcess.PriorityClass = "BelowNormal"
39
39
 
40
- $Value = (Get-WmiObject Win32_PerfFormattedData_PerfOS_System).ProcessorQueueLength
40
+ $Value = (Get-CimInstance -className Win32_PerfFormattedData_PerfOS_System).ProcessorQueueLength
41
41
 
42
42
  If ($Value -gt $CRITICAL) {
43
43
  Write-Host CheckWindowsProcessorQueueLength CRITICAL: Processor Queue at $Value.
@@ -37,7 +37,7 @@ Param(
37
37
  $ThisProcess = Get-Process -Id $pid
38
38
  $ThisProcess.PriorityClass = "BelowNormal"
39
39
 
40
- $Memory = (Get-WmiObject -Query "SELECT TotalVisibleMemorySize, FreePhysicalMemory FROM Win32_OperatingSystem")
40
+ $Memory = (Get-CimInstance -ClassName Win32_OperatingSystem)
41
41
 
42
42
  $Value = [System.Math]::Round(((($Memory.TotalVisibleMemorySize-$Memory.FreePhysicalMemory)/$Memory.TotalVisibleMemorySize)*100),2)
43
43
 
@@ -38,7 +38,7 @@ if ($UseFullyQualifiedHostname -eq $false) {
38
38
  $Path = [System.Net.Dns]::GetHostEntry([string]"localhost").HostName.toLower()
39
39
  }
40
40
 
41
- $AllDisks = Get-WMIObject Win32_LogicalDisk -Filter "DriveType = 3" | ? { $_.DeviceID -notmatch "[ab]:"}
41
+ $AllDisks = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DriveType = 3" | Where-Object { $_.DeviceID -notmatch "[ab]:"}
42
42
 
43
43
  foreach ($ObjDisk in $AllDisks)
44
44
  {
@@ -37,7 +37,7 @@ if ($UseFullyQualifiedHostname -eq $false) {
37
37
  $Path = [System.Net.Dns]::GetHostEntry([string]"localhost").HostName.toLower()
38
38
  }
39
39
 
40
- $Value = (Get-WmiObject Win32_PerfFormattedData_PerfOS_System).ProcessorQueueLength
40
+ $Value = (Get-CimInstance -ClassName Win32_PerfFormattedData_PerfOS_System).ProcessorQueueLength
41
41
  $Time = DateTimeToUnixTimestamp -DateTime (Get-Date)
42
42
 
43
43
  Write-Host "$Path.cpu.queue_length $Value $Time"
@@ -37,8 +37,9 @@ if ($UseFullyQualifiedHostname -eq $false) {
37
37
  $Path = [System.Net.Dns]::GetHostEntry([string]"localhost").HostName.toLower()
38
38
  }
39
39
 
40
- $FreeMemory = (Get-WmiObject -Query "SELECT TotalVisibleMemorySize, FreePhysicalMemory FROM Win32_OperatingSystem").FreePhysicalMemory
41
- $TotalMemory = (Get-WmiObject -Query "SELECT TotalVisibleMemorySize, FreePhysicalMemory FROM Win32_OperatingSystem").TotalVisibleMemorySize
40
+ $Memory = (Get-CimInstance -ClassName Win32_OperatingSystem)
41
+ $FreeMemory = $Memory.FreePhysicalMemory
42
+ $TotalMemory = $Memory.TotalVisibleMemorySize
42
43
  $UsedMemory = $TotalMemory-$FreeMemory
43
44
 
44
45
  $Value = [System.Math]::Round(((($TotalMemory-$FreeMemory)/$TotalMemory)*100),2)
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsWindows
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 8
5
- PATCH = 1
4
+ MINOR = 9
5
+ PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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.8.1
4
+ version: 2.9.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: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2018-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin