Skip to content

Commit f2e55d0

Browse files
committed
Initial commit
0 parents  commit f2e55d0

File tree

59 files changed

+4200
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4200
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Icinga PowerShell Plugins
2+
3+
This repository provides a collection of Windows check Plugins for the [Icinga PowerShell Framework](https://github.com/Icinga/icinga-powershell-framework)
4+
5+
Before you continue, please take a look on the [installation guide](doc/02-Installation.md)
6+
7+
## Documentation
8+
9+
Please take a look on the following content to get to know the possibilities of the module including examples on how to use it.
10+
11+
* [Introduction](doc/01-Introduction.md)
12+
* [Installation Guide](doc/02-Installation.md)
13+
* [Icinga Integration](doc/03-Icinga-Integration.md)
14+
* [Plugin Documentation](doc/10-Icinga-Plugins.md)
15+
16+
## Contributing
17+
18+
The Icinga Windows Module is an Open Source project and lives from your contributions. No matter whether these are feature requests, issues, translations, documentation or code.
19+
20+
* Please check whether a related issue already exists on our [Issue Tracker](https://github.com/Icinga/icinga-powershell-plugins/issues)
21+
* Send a [Pull Request](https://github.com/Icinga/icinga-powershell-plugins/pulls)
22+
* The master branche shall never be corrupt!

doc/01-Introduction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Introduction
2+
3+
This repository provides a wide range of check plugins for the Open Source monitoring solution [Icinga 2](https://icinga.com). All included plugins will require the [Icinga PowerShell Framework](https://github.com/Icinga/icinga-powershell-framework) as core framework for executing checks and providing Icinga formated output.
4+
5+
This repository will be extended whenever there are new plugins available. The separation will ensure updates of plugins are possible without having to upgrade huge elements of the PowerShell Framework itself.
6+
7+
Please have a look on the [Installation Guide](doc/02-Installation.md) to get started.

doc/02-Installation.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Installation Guide
2+
3+
There are different ways available to actually install this repository onto your machine
4+
5+
## Manual Installation
6+
7+
Installing the PowerShell plugins works like any other PowerShell module. You will have to get to know which folders are configured as PowerShell module folders and extract the content of this repository there.
8+
9+
To display the available list, open a PowerShell and type in the following command:
10+
11+
```powershell
12+
$env:PSModulePath
13+
```
14+
15+
## PowerShell Gallery
16+
17+
You can use the PowerShell Gallery to install the module directly from there
18+
19+
```powershell
20+
Install-Module icinga-powershell-plugins
21+
```
22+
23+
## Icinga Framework
24+
25+
The setup wizard of the PowerShell Framework will ask you if you wish to install plugins from a specific repository. In addition, you can update the plugins manually by loading the framework components and running the install Cmdlet
26+
27+
```powershell
28+
Use-Icinga;
29+
Install-IcingaFrameworkPlugins;
30+
```

doc/03-Icinga-Integration.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Icinga Integration
2+
3+
Once you followed the [Installation Guide](02-Installation.md) you are ready to start the integration into Icinga 2. This will allow you to configure your Check-Commands and start using them inside service templates and services.
4+
5+
For this you will require to have the [Icinga PowerShell Framework](https://github.com/Icinga/icinga-powershell-framework) installed on your system.
6+
Once done, follow the [Icinga Integration](https://github.com/Icinga/icinga-powershell-framework/blob/master/doc/05-IcingaIntegration.md) documentation there.

doc/10-Icinga-Plugins.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Icinga Plugins
2+
3+
Below you will find a documentation for every single available plugin provided by this repository
4+
5+
* [Invoke-IcingaCheckBiosSerial](plugins/01-Invoke-IcingaCheckBiosSerial.md)
6+
* [Invoke-IcingaCheckCheckSum](plugins/02-Invoke-IcingaCheckCheckSum.md)
7+
* [Invoke-IcingaCheckCPU](plugins/03-Invoke-IcingaCheckCPU.md)
8+
* [Invoke-IcingaCheckDirectory](plugins/04-Invoke-IcingaCheckDirectory.md)
9+
* [Invoke-IcingaCheckEventlog](plugins/05-Invoke-IcingaCheckEventlog.md)
10+
* [Invoke-IcingaCheckFirewall](plugins/06-Invoke-IcingaCheckFirewall.md)
11+
* [Invoke-IcingaCheckMemory](plugins/07-Invoke-IcingaCheckMemory.md)
12+
* [Invoke-IcingaCheckPerfcounter](plugins/08-Invoke-IcingaCheckPerfcounter.md)
13+
* [Invoke-IcingaCheckProcessCount](plugins/09-Invoke-IcingaCheckProcessCount.md)
14+
* [Invoke-IcingaCheckService](plugins/10-Invoke-IcingaCheckService.md)
15+
* [Invoke-IcingaCheckUpdates](plugins/11-Invoke-IcingaCheckUpdates.md)
16+
* [Invoke-IcingaCheckUptime](plugins/12-Invoke-IcingaCheckUptime.md)
17+
* [Invoke-IcingaCheckUsedPartitionSpace](plugins/13-Invoke-IcingaCheckUsedPartitionSpace.md)
18+
* [Invoke-IcingaCheckUsers](plugins/14-Invoke-IcingaCheckUsers.md)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# Invoke-IcingaCheckBiosSerial
3+
4+
## Description
5+
6+
Finds out the Bios Serial
7+
8+
Invoke-IcingaCheckBiosSerial returns either the Bios Serial or nothing.
9+
More Information on https://github.com/Icinga/icinga-powershell-plugins
10+
11+
## Examples
12+
13+
### Example Command 1
14+
15+
```powershell
16+
Invoke-IcingaCheckBiosSerial
17+
```
18+
19+
### Example Output 1
20+
21+
```powershell
22+
[OK]: SerialNumber is 1234-5678-9101-1121-3141-5161-7100
23+
```
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
# Invoke-IcingaCheckCheckSum
3+
4+
## Description
5+
6+
Checks hash against filehash of a file
7+
8+
Invoke-IcingaCheckCheckSum returns either 'OK' or 'CRITICAL', whether the check matches or not.
9+
10+
More Information on https://github.com/Icinga/icinga-powershell-plugins
11+
12+
## Arguments
13+
14+
| Argument | Type | Required | Default | Description |
15+
| --- | --- | --- | --- | --- |
16+
| Path | String | false | | |
17+
| Algorithm | String | false | SHA256 | Used to specify a string, which contains the algorithm to be used. Allowed algorithms: 'SHA1', 'SHA256', 'SHA384', 'SHA512', 'MD5' |
18+
| Hash | String | false | | |
19+
| NoPerfData | SwitchParameter | false | False | |
20+
| Verbosity | Int32 | false | 0 | |
21+
22+
## Examples
23+
24+
### Example Command 1
25+
26+
```powershell
27+
Invoke-IcingaCheckCheckSum -Path "C:\Users\Icinga\Downloads\test.txt"
28+
```
29+
30+
### Example Output 1
31+
32+
```powershell
33+
[OK] CheckSum C:\Users\Icinga\Downloads\test.txt is 008FB84A017F5DFDAF038DB2FDD6934E6E5D9CD3C7AACE2F2168D7D93AF51E4B
34+
```
35+
36+
### Example Command 2
37+
38+
```powershell
39+
Invoke-IcingaCheckCheckSum -Path "C:\Users\Icinga\Downloads\test.txt" -Hash 008FB84A017F5DFDAF038DB2FDD6934E6E5D9CD3C7AACE2F2168D7D93AF51E4B
40+
```
41+
42+
### Example Output 2
43+
44+
```powershell
45+
[OK] CheckSum C:\Users\Icinga\Downloads\test.txt is 008FB84A017F5DFDAF038DB2FDD6934E6E5D9CD3C7AACE2F2168D7D93AF51E4B|
46+
```
47+
48+
### Example Command 3
49+
50+
```powershell
51+
Invoke-IcingaCheckCheckSum -Path "C:\Users\Icinga\Downloads\test.txt" -Hash 008FB84A017F5DFDAF038DB2FDD6934E6E5D
52+
```
53+
54+
### Example Output 3
55+
56+
```powershell
57+
[CRITICAL] CheckSum C:\Users\Icinga\Downloads\test.txt 008FB84A017F5DFDAF038DB2FDD6934E6E5D9CD3C7AACE2F2168D7D93AF51E4B is not matching 008FB84A017F5DFDAF038DB2FDD6934E6E5D
58+
```
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# Invoke-IcingaCheckCPU
3+
4+
## Description
5+
6+
Checks cpu usage of cores.
7+
8+
Invoke-IcingaCheckCPU returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set.
9+
e.g A system has 4 cores, each running at 60% usage, WARNING is set to 50%, CRITICAL is set to 75%. In this case the check will return WARNING.
10+
More Information on https://github.com/Icinga/icinga-powershell-plugins
11+
12+
## Arguments
13+
14+
| Argument | Type | Required | Default | Description |
15+
| --- | --- | --- | --- | --- |
16+
| Warning | Object | false | | Used to specify a Warning threshold. In this case an integer value. |
17+
| Critical | Object | false | | Used to specify a Critical threshold. In this case an integer value. |
18+
| Core | String | false | * | Used to specify a single core to check for. |
19+
| NoPerfData | SwitchParameter | false | False | |
20+
| Verbosity | Int32 | false | 0 | |
21+
22+
## Examples
23+
24+
### Example Command 1
25+
26+
```powershell
27+
Invoke-IcingaCheckCpu -Warning 50 -Critical 75
28+
```
29+
30+
### Example Output 1
31+
32+
```powershell
33+
[OK]: Check package "CPU Load" is [OK]| 'Core #0'=4,59%;50;75;0;100 'Core #1'=0,94%;50;75;0;100 'Core #2'=11,53%;50;75;0;100 'Core #3'=4,07%;50;75;0;100
34+
```
35+
36+
### Example Command 2
37+
38+
```powershell
39+
Invoke-IcingaCheckCpu -Warning 50 -Critical 75 -Core 1
40+
```
41+
42+
### Example Output 2
43+
44+
```powershell
45+
[OK]: Check package "CPU Load" is [OK]| 'Core #1'=2,61%;50;75;0;100
46+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
2+
# Invoke-IcingaCheckDirectory
3+
4+
## Description
5+
6+
Checks how many files are in a directory.
7+
8+
Invoke-IcingaCheckDirectory returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set.
9+
e.g 'C:\Users\Icinga\Backup' contains 200 files, WARNING is set to 150, CRITICAL is set to 300. In this case the check will return CRITICAL
10+
More Information on https://github.com/Icinga/icinga-powershell-plugins
11+
12+
## Arguments
13+
14+
| Argument | Type | Required | Default | Description |
15+
| --- | --- | --- | --- | --- |
16+
| Path | String | false | | Used to specify a path. e.g. 'C:\Users\Icinga\Downloads' |
17+
| FileNames | Array | false | | Used to specify an array of filenames or expressions to match against. e.g '*.txt', '*.sql' # Fiends all files ending with .txt and .sql |
18+
| Recurse | SwitchParameter | false | False | A switch, which can be set to filter through directories recursively. |
19+
| Critical | Object | false | | Used to specify a Critical threshold. In this case an integer value. |
20+
| Warning | Object | false | | Used to specify a Warning threshold. In this case an integer value. |
21+
| ChangeTimeEqual | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have been changed 20 days ago are considered within the check. |
22+
| ChangeYoungerThan | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have a change date younger then 20 days are considered within the check. |
23+
| ChangeOlderThan | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have a change date older then 20 days are considered within the check. |
24+
| CreationTimeEqual | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have been created 20 days ago are considered within the check. |
25+
| CreationOlderThan | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have a creation date older then 20 days are considered within the check. |
26+
| CreationYoungerThan | String | false | | String that expects input format like "20d", which translates to 20 days. Allowed units: ms, s, m, h, d, w, M, y. Thereby all files which have a creation date younger then 20 days are considered within the check. |
27+
| FileSizeGreaterThan | String | false | | |
28+
| FileSizeSmallerThan | String | false | | |
29+
| Verbosity | Int32 | false | 0 | |
30+
| NoPerfData | SwitchParameter | false | False | |
31+
32+
## Examples
33+
34+
### Example Command 1
35+
36+
```powershell
37+
Invoke-IcingaCheckDirectory -Path "C:\Users\Icinga\Downloads" -Warning 20 -Critical 30 -Verbosity 3
38+
```
39+
40+
### Example Output 1
41+
42+
```powershell
43+
[OK]: Check package "C:\Users\Icinga\Downloads" is [OK] (Match All) \_ [OK]: C:\Users\Icinga\Downloads is 19
44+
```
45+
46+
### Example Command 2
47+
48+
```powershell
49+
Invoke-IcingaCheckDirectory -Path "C:\Users\Icinga\Downloads" -Warning 20 -Critical 30 -Verbosity 3
50+
```
51+
52+
### Example Output 2
53+
54+
```powershell
55+
[WARNING]: Check package "C:\Users\Icinga\Downloads" is [WARNING] (Match All) \_ [WARNING]: C:\Users\Icinga\Downloads is 24
56+
```
57+
58+
### Example Command 3
59+
60+
```powershell
61+
Invoke-IcingaCheckDirectory -Path "C:\Users\Icinga\Downloads" -Warning 20 -Critical 30 -Verbosity 3 -ChangeYoungerThen 20d -ChangeOlderThen 10d
62+
```
63+
64+
### Example Output 3
65+
66+
```powershell
67+
[OK]: Check package "C:\Users\Icinga\Downloads" is [OK] (Match All) \_ [OK]: C:\Users\Icinga\Downloads is 1
68+
```
69+
70+
### Example Command 4
71+
72+
```powershell
73+
Invoke-IcingaCheckDirectory -Path "C:\Users\Icinga\Downloads" -FileNames "*.txt","*.sql" -Warning 20 -Critical 30 -Verbosity 3
74+
```
75+
76+
### Example Output 4
77+
78+
```powershell
79+
[OK]: Check package "C:\Users\Icinga\Downloads" is [OK] (Match All) \_ [OK]: C:\Users\Icinga\Downloads is 4
80+
```
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
# Invoke-IcingaCheckEventlog
3+
4+
## Description
5+
6+
Checks how many eventlog occurences of a given type there are.
7+
8+
Invoke-IcingaCheckEventlog returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set.
9+
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.
10+
11+
More Information on https://github.com/Icinga/icinga-powershell-plugins
12+
13+
## Arguments
14+
15+
| Argument | Type | Required | Default | Description |
16+
| --- | --- | --- | --- | --- |
17+
| Warning | Object | false | | Used to specify a Warning threshold. |
18+
| Critical | Object | false | | Used to specify a Critical threshold. |
19+
| LogName | String | false | | Used to specify a certain log. |
20+
| IncludeEventId | Array | false | | Used to specify an array of events identified by their id to be included. |
21+
| ExcludeEventId | Array | false | | Used to specify an array of events identified by their id to be excluded. |
22+
| IncludeUsername | Array | false | | Used to specify an array of usernames within the eventlog to be included. |
23+
| ExcludeUsername | Array | false | | Used to specify an array of usernames within the eventlog to be excluded. |
24+
| IncludeEntryType | Array | false | | Used to specify an array of entry types within the eventlog to be included. |
25+
| ExcludeEntryType | Array | false | | Used to specify an array of entry types within the eventlog to be excluded. |
26+
| IncludeMessage | Array | false | | Used to specify an array of messages within the eventlog to be included. |
27+
| ExcludeMessage | Array | false | | Used to specify an array of messages within the eventlog to be excluded. |
28+
| After | Object | false | | Used to specify a date like dd.mm.yyyy and every eventlog entry after that date will be considered. |
29+
| Before | Object | false | | Used to specify a date like dd.mm.yyyy and every eventlog entry before that date will be considered. |
30+
| DisableTimeCache | SwitchParameter | false | False | 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. |
31+
| NoPerfData | SwitchParameter | false | False | |
32+
| Verbosity | Int32 | false | 0 | |
33+
34+
## Examples
35+
36+
### Example Command 1
37+
38+
```powershell
39+
Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000
40+
```
41+
42+
### Example Output 1
43+
44+
```powershell
45+
[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;;PS> Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000[OK]: Check package "EventLog" is [OK]|
46+
```
47+
48+
### Example Command 2
49+
50+
```powershell
51+
Invoke-IcingaCheckEventlog -LogName Application -IncludeEntryType Warning -Warning 100 -Critical 1000
52+
```
53+
54+
### Example Output 2
55+
56+
```powershell
57+
[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;;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;;
58+
```

0 commit comments

Comments
 (0)