sensu-plugins-windows 2.0.0 → 2.1.0

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
2
  SHA1:
3
- metadata.gz: 26f077c4e38c5278ae5d09c1e428609d9ca9a00f
4
- data.tar.gz: 1550daeb508c3f7b8e5e0b641719f02402573540
3
+ metadata.gz: 377a2b75e1e7bd9d94ad88e3e5e84711df72a21d
4
+ data.tar.gz: c6a97eb3efa5a6e9251984e127861453aafbdd99
5
5
  SHA512:
6
- metadata.gz: 6289e88f850bd0f62fd17460c22487ebec84211d09b4ccfda9edfce5a9b8d32a48bc96e39b177e474bc374d3f4b2ffc8a3899d4a6c9af1bd134528bfa0a22e13
7
- data.tar.gz: 6725768261b9b9cb56f21f888b72189832f297bbe3c0538b932b12deadb1db8b5a0ae730a5f99b5460cff9d6806c894e65e220f65933402b493f05be3bb45018
6
+ metadata.gz: db43777f468634d77a6fc2d408bf7e14f44ea5fa3aa95866a57bd6ec7179062d5bf8207a3e4c18f169600ae77098ca9e693f5d7f93cf287452496c30a52a3a68
7
+ data.tar.gz: e954695bf78a8d42dcf9c5c27ede9681d97d84c2824bec3ff772ee01ca3f592c2de6ce4a0dde0638570563d28cc5b2734b2c6adf650a8f1d6d32d3b31db27a6b
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/).
5
5
 
6
6
  ## [Unreleased]
7
+ ### [2.1.0] - 2017-08-26
8
+ ### Added
9
+ - `powershell/check-windows-pagefile.ps1`: which basically allows checking how much pagefile (aka swap) is in use. (@hulkk)
7
10
 
8
11
  ## [2.0.0] - 2017-06-27
9
12
  ### Fixed
@@ -101,6 +104,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
101
104
  - Initial release
102
105
 
103
106
  [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.0.0...HEAD
107
+ [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.0.0...2.1.0
104
108
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/1.0.0...2.0.0
105
109
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/0.1.0...1.0.0
106
110
  [0.1.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/v0.0.10...0.1.0
data/README.md CHANGED
@@ -32,6 +32,7 @@ These files provide basic Checks and Metrics for a Windows system.
32
32
  * bin/powershell/check-windows-cpu-load.ps1
33
33
  * bin/powershell/check-windows-disk.ps1
34
34
  * bin/powershell/check-windows-disk-writeable.ps1
35
+ * bin/powershell/check-windows-pagefile.ps1
35
36
  * bin/powershell/check-windows-process.ps1
36
37
  * bin/powershell/check-windows-processor-queue-length.ps1
37
38
  * bin/powershell/check-windows-ram.ps1
@@ -0,0 +1,55 @@
1
+ #
2
+ # check-windows-pagefile.ps1
3
+ #
4
+ # DESCRIPTION:
5
+ # This plugin collects the Pagefile Usage and compares against the WARNING and CRITICAL thresholds.
6
+ #
7
+ # OUTPUT:
8
+ # plain text
9
+ #
10
+ # PLATFORMS:
11
+ # Windows
12
+ #
13
+ # DEPENDENCIES:
14
+ # Powershell 3.0 or above
15
+ #
16
+ # USAGE:
17
+ # Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -File C:\\opt\\sensu\\plugins\\check-windows-pagefile.ps1 75 85
18
+ #
19
+ # NOTES:
20
+ #
21
+ # LICENSE:
22
+ # Copyright 2016 sensu-plugins
23
+ # Released under the same terms as Sensu (the MIT license); see LICENSE for details.
24
+ #
25
+
26
+ #Requires -Version 3.0
27
+
28
+ [CmdletBinding()]
29
+ Param(
30
+ [Parameter(Mandatory=$True,Position=1)]
31
+ [int]$WARNING,
32
+
33
+ [Parameter(Mandatory=$True,Position=2)]
34
+ [int]$CRITICAL
35
+ )
36
+
37
+ $ThisProcess = Get-Process -Id $pid
38
+ $ThisProcess.PriorityClass = "BelowNormal"
39
+
40
+ [int]$pagefileAllocated = Get-WmiObject -Class Win32_PageFileUsage | Select -ExpandProperty AllocatedBaseSize
41
+ [int]$pagefileCurrentUsage = Get-WmiObject -Class Win32_PageFileUsage | Select -ExpandProperty CurrentUsage
42
+
43
+ [int]$Value = ($pagefileCurrentUsage/$pagefileAllocated) * 100
44
+
45
+ If ($Value -gt $CRITICAL) {
46
+ Write-Host CheckWindowsPagefile CRITICAL: Pagefile usage at $Value%.
47
+ Exit 2 }
48
+
49
+ If ($Value -gt $WARNING) {
50
+ Write-Host CheckWindowsPagefile WARNING: Pagefile usage at $Value%.
51
+ Exit 1 }
52
+
53
+ Else {
54
+ Write-Host CheckWindowsPagefile OK: Pagefile usage at $Value%.
55
+ Exit 0 }
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsWindows
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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.0.0
4
+ version: 2.1.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: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -187,6 +187,7 @@ files:
187
187
  - bin/powershell/check-windows-disk-writeable.ps1
188
188
  - bin/powershell/check-windows-disk.ps1
189
189
  - bin/powershell/check-windows-http.ps1
190
+ - bin/powershell/check-windows-pagefile.ps1
190
191
  - bin/powershell/check-windows-process.ps1
191
192
  - bin/powershell/check-windows-processor-queue-length.ps1
192
193
  - bin/powershell/check-windows-ram.ps1