From 2314ef6f76a1c27812a8fe0d17a1abd97d181fd7 Mon Sep 17 00:00:00 2001 From: Crited Date: Tue, 29 Oct 2019 16:02:31 +0100 Subject: [PATCH] Added Documentation/Changed Documentation --- lib/plugins/Invoke-IcingaCheckEventlog.psm1 | 39 ++++++++++++------- .../Invoke-IcingaCheckPerfcounter.psm1 | 15 ++++--- lib/plugins/Invoke-IcingaCheckUptime.psm1 | 5 +-- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/lib/plugins/Invoke-IcingaCheckEventlog.psm1 b/lib/plugins/Invoke-IcingaCheckEventlog.psm1 index 353a21a..1cea274 100644 --- a/lib/plugins/Invoke-IcingaCheckEventlog.psm1 +++ b/lib/plugins/Invoke-IcingaCheckEventlog.psm1 @@ -2,27 +2,36 @@ Import-IcingaLib icinga\plugin; <# .SYNOPSIS - ??? + Checks how many eventlog occurences of a given type there are. .DESCRIPTION - ??? - e.g + Invoke-IcingaCheckEventlog returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set. + e.g Eventlog returns 500 entrys with the specified parameters, WARNING is set to 200, CRITICAL is set to 800. Thereby the check will return WARNING. More Information on https://github.com/LordHepipud/icinga-module-windows .FUNCTIONALITY - ??? + This Module is intended to be used to check how many eventlog occurences of a given type there are. Based on the thresholds set the status will change between 'OK', 'WARNING' or 'CRITICAL'. The function will return one of these given codes. .EXAMPLE - PS> + PS> Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000 + [WARNING]: Check package "EventLog" is [WARNING] + | 'EventId_508'=2c;; 'EventId_2002'=586c;; 'EventId_63'=6c;; 'EventId_2248216578'=1364c;; 'EventId_1008'=1745c;; 'EventId_2147489653'=1c;; 'EventId_636'=3c;; 'EventId_2147484656'=1c;; 'EventId_2147489654'=1c;; 'EventId_640'=3c;; 'EventId_533'=1c;; + 1 + PS> Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000 + [OK]: Check package "EventLog" is [OK]| + 0 .EXAMPLE - PS> -.EXAMPLE - PS> -.EXAMPLE - PS> + PS> Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000 + [WARNING]: Check package "EventLog" is [WARNING] + | 'EventId_508'=2c;; 'EventId_2002'=586c;; 'EventId_63'=6c;; 'EventId_2248216578'=1364c;; 'EventId_1008'=1745c;; 'EventId_2147489653'=1c;; 'EventId_636'=3c;; 'EventId_2147484656'=1c;; 'EventId_2147489654'=1c;; 'EventId_640'=3c;; 'EventId_533'=1c;; + 1 + PS> Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000 -DisableTimeCache + [WARNING]: Check package "EventLog" is [WARNING] + | 'EventId_508'=2c;; 'EventId_2002'=586c;; 'EventId_63'=6c;; 'EventId_2248216578'=1364c;; 'EventId_1008'=1745c;; 'EventId_2147489653'=1c;; 'EventId_636'=3c;; 'EventId_2147484656'=1c;; 'EventId_2147489654'=1c;; 'EventId_640'=3c;; 'EventId_533'=1c;; + 1 .PARAMETER Warning - Used to specify a Warning threshold. In this case an ??? value. + Used to specify a Warning threshold. .PARAMETER Critical - Used to specify a Critical threshold. In this case an ??? value. + Used to specify a Critical threshold. .PARAMETER LogName Used to specify a certain log. .PARAMETER IncludeEventId @@ -42,11 +51,13 @@ Import-IcingaLib icinga\plugin; .PARAMETER ExcludeMessage Used to specify an array of messages within the eventlog to be excluded. .PARAMETER After - ??? + Used to specify a date like dd.mm.yyyy and every eventlog entry after that date will be considered. .PARAMETER Before - ??? + Used to specify a date like dd.mm.yyyy and every eventlog entry before that date will be considered. .PARAMETER DisableTimeCache Switch to disable the time cache on a check. If this parameter is set the time cache is disabled. + After the check has been run once, the next check instance will filter through the eventlog from the point the last check ended. + This is due to the time cache, when disabled the whole eventlog is checked instead. .INPUTS System.String .OUTPUTS diff --git a/lib/plugins/Invoke-IcingaCheckPerfcounter.psm1 b/lib/plugins/Invoke-IcingaCheckPerfcounter.psm1 index e771716..50726ec 100644 --- a/lib/plugins/Invoke-IcingaCheckPerfcounter.psm1 +++ b/lib/plugins/Invoke-IcingaCheckPerfcounter.psm1 @@ -5,20 +5,19 @@ Import-IcingaLib icinga\plugin; Performs checks on various performance counter .DESCRIPTION Invoke-IcingaCheckDirectory returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set. - e.g + Use "Show-IcingaPerformanceCounterCategories" to see all performance counter categories available. + To gain insight on an specific performance counter use "Show-IcingaPerformanceCounters " + e.g ' More Information on https://github.com/LordHepipud/icinga-module-windows .FUNCTIONALITY This module is intended to be used to perform checks on different performance counter. Based on the thresholds set the status will change between 'OK', 'WARNING' or 'CRITICAL'. The function will return one of these given codes. .EXAMPLE - PS> -.EXAMPLE - PS> -.EXAMPLE - PS> -.EXAMPLE - PS> + PS> Invoke-IcingaCheckPerfCounter -PerfCounter '\processor(*)\% processor time' -Warning 60 -Critical 90 + [WARNING]: Check package "Performance Counter" is [WARNING] + | 'processor1_processor_time'=68.95;60;90 'processor3_processor_time'=4.21;60;90 'processor5_processor_time'=9.5;60;90 'processor_Total_processor_time'=20.6;60;90 'processor0_processor_time'=5.57;60;90 'processor2_processor_time'=0;60;90 'processor4_processor_time'=6.66;60;90 + 1 .PARAMETER Warning Used to specify a Warning threshold. In this case an ??? value. .PARAMETER Critical diff --git a/lib/plugins/Invoke-IcingaCheckUptime.psm1 b/lib/plugins/Invoke-IcingaCheckUptime.psm1 index f71a871..c4da1ac 100644 --- a/lib/plugins/Invoke-IcingaCheckUptime.psm1 +++ b/lib/plugins/Invoke-IcingaCheckUptime.psm1 @@ -12,15 +12,14 @@ Import-IcingaLib core\tools; .FUNCTIONALITY This module is intended to check how long a Windows system has been up for. Based on the thresholds set the status will change between 'OK', 'WARNING' or 'CRITICAL'. The function will return one of these given codes. - .EXAMPLE PS> Invoke-IcingaCheckUptime -Warning 18d -Critical 20d [WARNING]: Check package "Windows Uptime: Days: 19 Hours: 13 Minutes: 48 Seconds: 29" is [WARNING] | 'Windows Uptime'=1691309,539176s;1555200;1728000 -.PARAMETER IcingaCheckUsers_String_Warning +.PARAMETER Warning Used to specify a Warning threshold. In this case a string. Allowed units include: ms, s, m, h, d, w, M, y -.PARAMETER IcingaCheckUsers_String_Critical +.PARAMETER Critical Used to specify a Critical threshold. In this case a string. Allowed units include: ms, s, m, h, d, w, M, y .INPUTS