sensu-plugins-windows 2.5.0 → 2.6.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: 34416dd0408bd2121719a7a26c27bc8496110e594dd704a5d93c3853ea8e9cf9
4
- data.tar.gz: bde0a9969c9afebdd70d7e07026423124459d532e8814b7ba0af7389c345a5f8
3
+ metadata.gz: b7b98e57c48291e2dae995cccdb92c0754b4a33ba3cff2f72b80812c50c26684
4
+ data.tar.gz: 1b65662d798a563a9e615acbf6f379c78b3bb2e1e02afed8528ccf239e660e55
5
5
  SHA512:
6
- metadata.gz: 4a5ff8d9c2e6f65c37fa59b880e9d0b7c33af74fe125014b163672a3dad1b30a4f59a7fde693589c6dca7aa4ef32a3618f413d2a40570989e12d5e757c6e1d19
7
- data.tar.gz: 4e43cce4a22742f5c39787450f4cf70a0f1bb8644dc012ac44d803511eb2a74e8bb0f055be52e67ff42682453db2677639822132e2ed00c70f6f3f8932141c70
6
+ metadata.gz: 52373fe594cae7d0a84c0e2c014bb242d780c22b8df7bbac828d8599afd32890054037f42c73d1018d433257b8bed5145ce0f0b2f598c564b2bcad5b6113308f
7
+ data.tar.gz: 242135a9e0eb5153632fbb1712d125c670ee474b9affcd1ae51a992e632a76ea1322b983c02766f42ec646c20259f6850be232520d4841c51006bfd0ea573160
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.6.0] - 2018-05-09
10
+ ### Added
11
+ - check-windows-event-log.ps1, added plugin to check for pattern and returns the number criticals and warnings that match that pattern (@patricewhite).
12
+
13
+ ### Changed
14
+ - README.md, changed to include new plugin (@patricewhite).
15
+
9
16
  ## [2.5.0] - 2018-05-02
10
17
  ### Added
11
18
  - powershell_helper.rb, added helper to wrap around Powershell directory (@makaveli0129).
@@ -150,7 +157,8 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
150
157
  ### Added
151
158
  - Initial release
152
159
 
153
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.5.0...HEAD
160
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.6.0...HEAD
161
+ [2.6.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.5.0...2.6.0
154
162
  [2.5.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.4.1...2.5.0
155
163
  [2.4.1]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.4.0...2.4.1
156
164
  [2.4.0]: https://github.com/sensu-plugins/sensu-plugins-Windows/compare/2.3.0...2.4.0
data/README.md CHANGED
@@ -46,6 +46,7 @@ These files provide basic Checks and Metrics for a Windows system.
46
46
  * bin/powershell/metric-windows-processor-queue-length.ps1
47
47
  * bin/powershell/metric-windows-ram-usage.ps1
48
48
  * bin/powershell/metric-windows-uptime.ps1
49
+ * bin/powershell/check-windows-event-log.ps1
49
50
 
50
51
  ## Usage
51
52
 
@@ -0,0 +1,51 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Returns all occurances of pattern in log file
4
+ .DESCRIPTION
5
+ Checks Event log for pattern and returns the number criticals and warnings that match that pattern.
6
+ .Notes
7
+ FileName : check-windows-event-log.ps1
8
+ Author : Patrice White - patrice.white@ge.com
9
+ .LINK
10
+ https://github.com/sensu-plugins/sensu-plugins-windows
11
+ .PARAMETER LogName
12
+ Required. The name of the log file.
13
+ Example -LogName Application
14
+ .PARAMETER Pattern
15
+ Required. The pattern you want to search for.
16
+ Example -LogName Application -Pattern error
17
+ .EXAMPLE
18
+ powershell.exe -file check-windows-log.ps1 -LogName Application -Pattern error
19
+ #>
20
+
21
+ [CmdletBinding()]
22
+ Param(
23
+ [Parameter(Mandatory=$True)]
24
+ [string]$LogName,
25
+ [Parameter(Mandatory=$True)]
26
+ [string]$Pattern
27
+ )
28
+
29
+ #Search for pattern inside of File
30
+ $ThisEvent = Get-WinEvent $LogName -ErrorAction SilentlyContinue | Where {$_.Message -like "*$($Pattern)*"}
31
+
32
+ If($ThisEvent -ne $null ){
33
+ $ThisEvent
34
+ }
35
+
36
+ #Counts the number of criticals and warnings
37
+ $CountCrits=($ThisEvent | Where{$_.LevelDisplayName -eq 'Critical'}).count
38
+ $CountWarns=($ThisEvent | Where{$_.LevelDisplayName -eq 'Warning'}).count
39
+
40
+ #Prints count of how many ciritials and warnings
41
+ If($CountCrits -eq 0 -And $CountWarns -eq 0){
42
+ "CheckLog OK: $CountCrits criticals $CountWarns warnings"
43
+ EXIT 0
44
+ }ElseIF ($CountCrits -gt 0) {
45
+ "CheckLog CRITICAL: $CountCrits criticals $CountWarns warnings"
46
+ EXIT 2
47
+ }
48
+ Else {
49
+ "CheckLog WARNING: $CountCrits criticals $CountWarns warnings"
50
+ EXIT 1
51
+ }
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsWindows
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 5
4
+ MINOR = 6
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.5.0
4
+ version: 2.6.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-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -194,6 +194,7 @@ files:
194
194
  - bin/powershell/check-windows-cpu-load.ps1
195
195
  - bin/powershell/check-windows-disk-writeable.ps1
196
196
  - bin/powershell/check-windows-disk.ps1
197
+ - bin/powershell/check-windows-event-log.ps1
197
198
  - bin/powershell/check-windows-http.ps1
198
199
  - bin/powershell/check-windows-pagefile.ps1
199
200
  - bin/powershell/check-windows-process.ps1