Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Updates plugin examples #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/plugins/09-Invoke-IcingaCheckMemory.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
24 changes: 18 additions & 6 deletions doc/plugins/16-Invoke-IcingaCheckUsedPartitionSpace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
19 changes: 12 additions & 7 deletions plugins/Invoke-IcingaCheckMemory.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
30 changes: 21 additions & 9 deletions plugins/Invoke-IcingaCheckUsedPartitionSpace.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down