Skip to content

Commit

Permalink
Add IcingaCheckPackage example draft
Browse files Browse the repository at this point in the history
  • Loading branch information
Crited authored Nov 4, 2019
1 parent fa8f31b commit f39c26b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/developerguide/02-New-IcingaCheckPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,23 @@ $IcingaPackage = New-IcingaCheckPackage -Name 'My Package' -OperatorAnd;
| Checks | Array | | Array of checks to be added to the check package |
| Verbose | int | | Defines the level of output detail from 0 lowest to 3 highest detail |
| Hidden | Switch | | If set, the check package doesn't generate output |


### Examples

#### Example 1

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`.

```powershell
$IcingaCheck1 = New-IcingaCheck -Name 'My Check 1' -Value 37 -Unit '%';
$IcingaCheck1.WarnOutOfRange(20).CritOutOfRange(35) | Out-Null;
$IcingaCheck2 = New-IcingaCheck -Name 'My Check 2' -Value 18 -Unit '%';
$IcingaCheck2.WarnOutOfRange(20).CritOutOfRange(35) | Out-Null;
$IcingaPackage = New-IcingaCheckPackage -Name 'My Package' -OperatorAnd;
$IcingaPackage.AddCheck($IcingaCheck1);
$IcingaPackage.AddCheck($IcingaCheck2);
```

0 comments on commit f39c26b

Please sign in to comment.