From 3b5456e414d4628ef6d4a09cf6ef256c91a7ac43 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 19 Nov 2021 12:17:18 +0100 Subject: [PATCH] Updates doc examples for plugins --- doc/plugins/09-Invoke-IcingaCheckMemory.md | 8 ++--- ...16-Invoke-IcingaCheckUsedPartitionSpace.md | 24 +++++++++++---- plugins/Invoke-IcingaCheckMemory.psm1 | 19 +++++++----- .../Invoke-IcingaCheckUsedPartitionSpace.psm1 | 30 +++++++++++++------ 4 files changed, 55 insertions(+), 26 deletions(-) diff --git a/doc/plugins/09-Invoke-IcingaCheckMemory.md b/doc/plugins/09-Invoke-IcingaCheckMemory.md index 0aec18a2..f20e378d 100644 --- a/doc/plugins/09-Invoke-IcingaCheckMemory.md +++ b/doc/plugins/09-Invoke-IcingaCheckMemory.md @@ -43,23 +43,23 @@ To execute this plugin you will require to grant the following user permissions. ### Example Command 1 ```powershell -Invoke-IcingaCheckMemory -Verbosity 3 -Warning 60 -Critical 80 +Invoke-IcingaCheckMemory -Verbosity 3 -Warning '60%' -Critical '80%' ``` ### Example Output 1 ```powershell -[WARNING]: % Memory Check 78.74 is greater than 60 +[OK] Memory Usage (All must be [OK])\_ [OK] PageFile Usage (All must be [OK])\_ [OK] C:\pagefile.sys: 278MB\_ [OK] Used Memory: 36.13% (23.10GiB)| 'used_memory'=24800540000B;41181786000;54909048000;0;68636310000 'pagefile_cpagefilesys'=278000000B;;;0;17408000000 ``` ### Example Command 2 ```powershell -Invoke-IcingaCheckMemory -WarningPercent 30 -CriticalPercent 50 +Invoke-IcingaCheckMemory -Verbosity 3 -Warning '50GB' -Critical '60GB' ``` ### Example Output 2 ```powershell -[WARNING] Check package "Memory Usage" - [WARNING] Memory Percent Used\_ [WARNING] Memory Percent Used: Value "48.07%" is greater than threshold "30%"| 'memory_percent_used'=48.07%;0:30;0:50;0;100 'used_bytes'=3.85GB;;;0;81 +[OK] Memory Usage (All must be [OK])\_ [OK] PageFile Usage (All must be [OK])\_ [OK] C:\pagefile.sys: 278MB\_ [OK] Used Memory: 22.92GiB| 'used_memory'=24605630000B;50000000000;60000000000;0;68636310000 'pagefile_cpagefilesys'=278000000B;;;0;17408000000 ``` diff --git a/doc/plugins/16-Invoke-IcingaCheckUsedPartitionSpace.md b/doc/plugins/16-Invoke-IcingaCheckUsedPartitionSpace.md index 247c1a0d..c5e833e5 100644 --- a/doc/plugins/16-Invoke-IcingaCheckUsedPartitionSpace.md +++ b/doc/plugins/16-Invoke-IcingaCheckUsedPartitionSpace.md @@ -50,35 +50,47 @@ To execute this plugin you will require to grant the following user permissions. ### Example Command 1 ```powershell -Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 +Invoke-IcingaCheckUsedPartitionSpace -Warning '60%' -Critical '80%' -CheckUsedSpace ``` ### Example Output 1 ```powershell -[OK]: Check package "Used Partition Space" is [OK]| 'Partition C'=8,06204986572266%;60;;0;100 'Partition D'=12,06204736572266%;60;;0;100 'Partition K'=19,062047896572266%;60;;0;100 +[CRITICAL] Used Partition Space: 2 Critical 1 Ok [CRITICAL] Partition C: (85.43% (795.22GiB)), Partition G: (87.50% (1.59TiB))\_ [CRITICAL] Partition C: 85.43% (795.22GiB) is greater than threshold 80% (744.71GiB)\_ [CRITICAL] Partition G: 87.50% (1.59TiB) is greater than threshold 80% (1.46TiB)| 'used_space_partition_r'=326052500000B;2400460800000;3200614400000;0;4000768000000 'used_space_partition_g'=1750369000000B;1200228600000;1600304800000;0;2000381000000 'used_space_partition_c'=853859000000B;599716680000;799622240000;0;999527800000 ``` ### Example Command 2 ```powershell -Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 -Exclude "C:" +Invoke-IcingaCheckUsedPartitionSpace -Warning '740GB' -Critical '800GB' -CheckUsedSpace ``` ### Example Output 2 ```powershell -[OK]: Check package "Used Partition Space" is [OK]| 'Partition D'=12,06204736572266%;60;;0;100 'Partition K'=19,062047896572266%;60;;0;100 +[CRITICAL] Used Partition Space: 2 Critical 1 Ok [CRITICAL] Partition C: (795.23GiB), Partition G: (1.59TiB)\_ [CRITICAL] Partition C: 795.23GiB is greater than threshold 745.06GiB\_ [CRITICAL] Partition G: 1.59TiB is greater than threshold 745.06GiB| 'used_space_partition_r'=326052500000B;740000000000;800000000000;0;4000768000000 'used_space_partition_g'=1750369000000B;740000000000;800000000000;0;2000381000000 'used_space_partition_c'=853874000000B;740000000000;800000000000;0;999527800000 ``` ### Example Command 3 ```powershell -Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 -Include "C:" +Invoke-IcingaCheckUsedPartitionSpace -Warning '300GB:' -Critical '200GB:' ``` ### Example Output 3 ```powershell -[OK]: Check package "Used Partition Space" is [OK]| 'Partition C'=8,06204986572266%;60;;0;100 +[CRITICAL] Free Partition Space: 1 Critical 1 Warning 1 Ok [CRITICAL] Partition C: (135.65GiB) [WARNING] Partition G: (232.84GiB)\_ [CRITICAL] Partition C: 135.65GiB is lower than threshold 186.26GiB\_ [WARNING] Partition G: 232.84GiB is lower than threshold 279.40GiB| 'free_space_partition_g'=250012600000B;300000000000:;200000000000:;0;2000381000000 'free_space_partition_r'=3674716000000B;300000000000:;200000000000:;0;4000768000000 'free_space_partition_c'=145653700000B;300000000000:;200000000000:;0;999527800000 +``` + +### Example Command 4 + +```powershell +Invoke-IcingaCheckUsedPartitionSpace -Warning '20%:' -Critical '10%:' +``` + +### Example Output 4 + +```powershell +[WARNING] Free Partition Space: 2 Warning 1 Ok [WARNING] Partition C: (14.57% (135.65GiB)), Partition G: (12.50% (232.84GiB))\_ [WARNING] Partition C: 14.57% (135.65GiB) is lower than threshold 20% (186.18GiB)\_ [WARNING] Partition G: 12.50% (232.84GiB) is lower than threshold 20% (372.60GiB)| 'free_space_partition_g'=250012600000B;400076200000:;200038100000:;0;2000381000000 'free_space_partition_r'=3674716000000B;800153600000:;400076800000:;0;4000768000000 'free_space_partition_c'=145656400000B;199905560000:;99952780000:;0;999527800000 ``` diff --git a/plugins/Invoke-IcingaCheckMemory.psm1 b/plugins/Invoke-IcingaCheckMemory.psm1 index d0af3d28..41aca14d 100644 --- a/plugins/Invoke-IcingaCheckMemory.psm1 +++ b/plugins/Invoke-IcingaCheckMemory.psm1 @@ -20,14 +20,19 @@ * Performance Monitor Users .EXAMPLE - PS>Invoke-IcingaCheckMemory -Verbosity 3 -Warning 60 -Critical 80 - [WARNING]: % Memory Check 78.74 is greater than 60 + PS> Invoke-IcingaCheckMemory -Verbosity 3 -Warning '60%' -Critical '80%' + [OK] Memory Usage (All must be [OK]) + \_ [OK] PageFile Usage (All must be [OK]) + \_ [OK] C:\pagefile.sys: 278MB + \_ [OK] Used Memory: 36.13% (23.10GiB) + | 'used_memory'=24800540000B;41181786000;54909048000;0;68636310000 'pagefile_cpagefilesys'=278000000B;;;0;17408000000 .EXAMPLE - PS> Invoke-IcingaCheckMemory -WarningPercent 30 -CriticalPercent 50 - [WARNING] Check package "Memory Usage" - [WARNING] Memory Percent Used - \_ [WARNING] Memory Percent Used: Value "48.07%" is greater than threshold "30%" - | 'memory_percent_used'=48.07%;0:30;0:50;0;100 'used_bytes'=3.85GB;;;0;8 - 1 + PS> Invoke-IcingaCheckMemory -Verbosity 3 -Warning '50GB' -Critical '60GB' + [OK] Memory Usage (All must be [OK]) + \_ [OK] PageFile Usage (All must be [OK]) + \_ [OK] C:\pagefile.sys: 278MB + \_ [OK] Used Memory: 22.92GiB + | 'used_memory'=24605630000B;50000000000;60000000000;0;68636310000 'pagefile_cpagefilesys'=278000000B;;;0;17408000000 .PARAMETER Warning Used to specify a Warning threshold. In this case an string value. The string has to be like, "20B", "20KB", "20MB", "20GB", "20TB", "20PB" diff --git a/plugins/Invoke-IcingaCheckUsedPartitionSpace.psm1 b/plugins/Invoke-IcingaCheckUsedPartitionSpace.psm1 index 1434114b..16514555 100644 --- a/plugins/Invoke-IcingaCheckUsedPartitionSpace.psm1 +++ b/plugins/Invoke-IcingaCheckUsedPartitionSpace.psm1 @@ -30,17 +30,29 @@ * Performance Monitor Users .EXAMPLE - PS>Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 - [OK]: Check package "Used Partition Space" is [OK] - | 'Partition C'=8,06204986572266%;60;;0;100 'Partition D'=12,06204736572266%;60;;0;100 'Partition K'=19,062047896572266%;60;;0;100 + PS>Invoke-IcingaCheckUsedPartitionSpace -Warning '60%' -Critical '80%' -CheckUsedSpace + [CRITICAL] Used Partition Space: 2 Critical 1 Ok [CRITICAL] Partition C: (85.43% (795.22GiB)), Partition G: (87.50% (1.59TiB)) + \_ [CRITICAL] Partition C: 85.43% (795.22GiB) is greater than threshold 80% (744.71GiB) + \_ [CRITICAL] Partition G: 87.50% (1.59TiB) is greater than threshold 80% (1.46TiB) + | 'used_space_partition_r'=326052500000B;2400460800000;3200614400000;0;4000768000000 'used_space_partition_g'=1750369000000B;1200228600000;1600304800000;0;2000381000000 'used_space_partition_c'=853859000000B;599716680000;799622240000;0;999527800000 .EXAMPLE - PS>Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 -Exclude "C:" - [OK]: Check package "Used Partition Space" is [OK] - | 'Partition D'=12,06204736572266%;60;;0;100 'Partition K'=19,062047896572266%;60;;0;100 + PS>Invoke-IcingaCheckUsedPartitionSpace -Warning '740GB' -Critical '800GB' -CheckUsedSpace + [CRITICAL] Used Partition Space: 2 Critical 1 Ok [CRITICAL] Partition C: (795.23GiB), Partition G: (1.59TiB) + \_ [CRITICAL] Partition C: 795.23GiB is greater than threshold 745.06GiB + \_ [CRITICAL] Partition G: 1.59TiB is greater than threshold 745.06GiB + | 'used_space_partition_r'=326052500000B;740000000000;800000000000;0;4000768000000 'used_space_partition_g'=1750369000000B;740000000000;800000000000;0;2000381000000 'used_space_partition_c'=853874000000B;740000000000;800000000000;0;999527800000 .EXAMPLE - PS>Invoke-IcingaCheckUsedPartitionSpace -Warning 60 -Critical 80 -Include "C:" - [OK]: Check package "Used Partition Space" is [OK] - | 'Partition C'=8,06204986572266%;60;;0;100 + PS>Invoke-IcingaCheckUsedPartitionSpace -Warning '300GB:' -Critical '200GB:' + [CRITICAL] Free Partition Space: 1 Critical 1 Warning 1 Ok [CRITICAL] Partition C: (135.65GiB) [WARNING] Partition G: (232.84GiB) + \_ [CRITICAL] Partition C: 135.65GiB is lower than threshold 186.26GiB + \_ [WARNING] Partition G: 232.84GiB is lower than threshold 279.40GiB + | 'free_space_partition_g'=250012600000B;300000000000:;200000000000:;0;2000381000000 'free_space_partition_r'=3674716000000B;300000000000:;200000000000:;0;4000768000000 'free_space_partition_c'=145653700000B;300000000000:;200000000000:;0;999527800000 +.EXAMPLE + PS>Invoke-IcingaCheckUsedPartitionSpace -Warning '20%:' -Critical '10%:' + [WARNING] Free Partition Space: 2 Warning 1 Ok [WARNING] Partition C: (14.57% (135.65GiB)), Partition G: (12.50% (232.84GiB)) + \_ [WARNING] Partition C: 14.57% (135.65GiB) is lower than threshold 20% (186.18GiB) + \_ [WARNING] Partition G: 12.50% (232.84GiB) is lower than threshold 20% (372.60GiB) + | 'free_space_partition_g'=250012600000B;400076200000:;200038100000:;0;2000381000000 'free_space_partition_r'=3674716000000B;800153600000:;400076800000:;0;4000768000000 'free_space_partition_c'=145656400000B;199905560000:;99952780000:;0;999527800000 .PARAMETER Warning Used to specify a Warning threshold. This can either be a byte-value type like '10GB' or a %-value, like '10%'