Skip to content

Commit f39c26b

Browse files
authored
Add IcingaCheckPackage example draft
1 parent fa8f31b commit f39c26b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/developerguide/02-New-IcingaCheckPackage.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,23 @@ $IcingaPackage = New-IcingaCheckPackage -Name 'My Package' -OperatorAnd;
2828
| Checks | Array | | Array of checks to be added to the check package |
2929
| Verbose | int | | Defines the level of output detail from 0 lowest to 3 highest detail |
3030
| Hidden | Switch | | If set, the check package doesn't generate output |
31+
32+
33+
### Examples
34+
35+
#### Example 1
36+
37+
Simple check package which requires both checks to be okay. Two simple check items with two different values in this case `37` and `18`. Based on the thresholds set, `20` for `warning` and `35` for `critical`, one of the checks will be `ok`, while the other enters the `critical` state. Both get added to an check package, which handles them with a logical AND conjunction. Thereby the IcingaPackage enters the `critical state`.
38+
39+
```powershell
40+
$IcingaCheck1 = New-IcingaCheck -Name 'My Check 1' -Value 37 -Unit '%';
41+
$IcingaCheck1.WarnOutOfRange(20).CritOutOfRange(35) | Out-Null;
42+
43+
$IcingaCheck2 = New-IcingaCheck -Name 'My Check 2' -Value 18 -Unit '%';
44+
$IcingaCheck2.WarnOutOfRange(20).CritOutOfRange(35) | Out-Null;
45+
46+
$IcingaPackage = New-IcingaCheckPackage -Name 'My Package' -OperatorAnd;
47+
$IcingaPackage.AddCheck($IcingaCheck1);
48+
$IcingaPackage.AddCheck($IcingaCheck2);
49+
```
50+

0 commit comments

Comments
 (0)