mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Documentation skeletons and actual documentation
This commit is contained in:
parent
dcf4ab6c1f
commit
4d614cacfa
6 changed files with 238 additions and 1 deletions
|
|
@ -1,3 +1,19 @@
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to byte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to byte.
|
||||||
|
e.g Kilobyte to Byte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-Byte -Unit TB 200
|
||||||
|
200000000000000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-Byte()
|
function ConvertTo-Byte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
@ -22,6 +38,22 @@ function ConvertTo-Byte()
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to kilobyte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to kilobyte.
|
||||||
|
e.g byte to kilobyte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-KiloByte -Unit TB 200
|
||||||
|
200000000000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-KiloByte()
|
function ConvertTo-KiloByte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
@ -46,6 +78,22 @@ function ConvertTo-KiloByte()
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to megabyte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to megabyte.
|
||||||
|
e.g byte to megabyte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-KiloByte -Unit TB 200
|
||||||
|
200000000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-MegaByte()
|
function ConvertTo-MegaByte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
@ -70,6 +118,22 @@ function ConvertTo-MegaByte()
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to gigabyte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to gigabyte.
|
||||||
|
e.g byte to gigabyte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-GigaByte -Unit TB 200
|
||||||
|
200000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-GigaByte()
|
function ConvertTo-GigaByte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
@ -94,6 +158,22 @@ function ConvertTo-GigaByte()
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to terabyte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to terabyte.
|
||||||
|
e.g byte to terabyte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-TeraByte -Unit GB 2000000
|
||||||
|
2000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-TeraByte()
|
function ConvertTo-TeraByte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
@ -118,6 +198,22 @@ function ConvertTo-TeraByte()
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit sizes to petabyte.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given unit size to petabyte.
|
||||||
|
e.g byte to petabyte.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-PetaByte -Unit GB 2000000
|
||||||
|
2
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-PetaByte()
|
function ConvertTo-PetaByte()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,26 @@
|
||||||
Import-IcingaLib core\tools;
|
Import-IcingaLib core\tools;
|
||||||
# year month week days hours minutes seconds milliseconds
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Converts unit to seconds.
|
||||||
|
.DESCRIPTION
|
||||||
|
This module converts a given time unit to seconds.
|
||||||
|
e.g hours to seconds.
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
|
||||||
|
.PARAMETER Value
|
||||||
|
Specify unit to be converted to seconds. Allowed units: ms, s, m, h, d, w, M, y
|
||||||
|
ms = miliseconds; s = seconds; m = minutes; h = hours; d = days; w = weeks; M = months; y = years;
|
||||||
|
|
||||||
|
Like 20d for 20 days.
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ConvertTo-Seconds 30d
|
||||||
|
2592000
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function ConvertTo-Seconds()
|
function ConvertTo-Seconds()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,19 @@
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Sets nummeric values to be negative
|
||||||
|
.DESCRIPTION
|
||||||
|
This module sets a numeric value to be negative.
|
||||||
|
e.g 12 to -12
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> Set-NumericNegative 32
|
||||||
|
-32
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
|
|
||||||
function Set-NumericNegative()
|
function Set-NumericNegative()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,17 @@
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Tests whether a value is numeric
|
||||||
|
.DESCRIPTION
|
||||||
|
This module tests whether a value is numeric
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.EXAMPLE
|
||||||
|
PS> Test-Numeric 32
|
||||||
|
True
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
function Test-Numeric ($number) {
|
function Test-Numeric ($number) {
|
||||||
return $number -Match "^[\d\.]+$";
|
return $number -Match "^[\d\.]+$";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,61 @@
|
||||||
Import-IcingaLib icinga\plugin;
|
Import-IcingaLib icinga\plugin;
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
???
|
||||||
|
.DESCRIPTION
|
||||||
|
???
|
||||||
|
e.g
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.FUNCTIONALITY
|
||||||
|
???
|
||||||
|
Based on the thresholds set the status will change between 'OK', 'WARNING' or 'CRITICAL'. The function will return one of these given codes.
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.PARAMETER Warning
|
||||||
|
Used to specify a Warning threshold. In this case an ??? value.
|
||||||
|
.PARAMETER Critical
|
||||||
|
Used to specify a Critical threshold. In this case an ??? value.
|
||||||
|
.PARAMETER LogName
|
||||||
|
Used to specify a certain log.
|
||||||
|
.PARAMETER IncludeEventId
|
||||||
|
Used to specify an array of events identified by their id to be included.
|
||||||
|
.PARAMETER ExcludeEventId
|
||||||
|
Used to specify an array of events identified by their id to be excluded.
|
||||||
|
.PARAMETER IncludeUsername
|
||||||
|
Used to specify an array of usernames within the eventlog to be included.
|
||||||
|
.PARAMETER ExcludeUsername
|
||||||
|
Used to specify an array of usernames within the eventlog to be excluded.
|
||||||
|
.PARAMETER IncludeEntryType
|
||||||
|
Used to specify an array of entry types within the eventlog to be included.
|
||||||
|
.PARAMETER ExcludeEntryType
|
||||||
|
Used to specify an array of entry types within the eventlog to be excluded.
|
||||||
|
.PARAMETER IncludeMessage
|
||||||
|
Used to specify an array of messages within the eventlog to be included.
|
||||||
|
.PARAMETER ExcludeMessage
|
||||||
|
Used to specify an array of messages within the eventlog to be excluded.
|
||||||
|
.PARAMETER After
|
||||||
|
???
|
||||||
|
.PARAMETER Before
|
||||||
|
???
|
||||||
|
.PARAMETER DisableTimeCache
|
||||||
|
Switch to disable the time cache on a check. If this parameter is set the time cache is disabled.
|
||||||
|
.INPUTS
|
||||||
|
System.String
|
||||||
|
.OUTPUTS
|
||||||
|
System.String
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function Invoke-IcingaCheckEventlog()
|
function Invoke-IcingaCheckEventlog()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,39 @@
|
||||||
Import-IcingaLib icinga\plugin;
|
Import-IcingaLib icinga\plugin;
|
||||||
|
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Performs checks on various performance counter
|
||||||
|
.DESCRIPTION
|
||||||
|
Invoke-IcingaCheckDirectory returns either 'OK', 'WARNING' or 'CRITICAL', based on the thresholds set.
|
||||||
|
e.g
|
||||||
|
|
||||||
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.FUNCTIONALITY
|
||||||
|
This module is intended to be used to perform checks on different performance counter.
|
||||||
|
Based on the thresholds set the status will change between 'OK', 'WARNING' or 'CRITICAL'. The function will return one of these given codes.
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.EXAMPLE
|
||||||
|
PS>
|
||||||
|
.PARAMETER Warning
|
||||||
|
Used to specify a Warning threshold. In this case an ??? value.
|
||||||
|
.PARAMETER Critical
|
||||||
|
Used to specify a Critical threshold. In this case an ??? value.
|
||||||
|
.PARAMETER PerfCounter
|
||||||
|
Used to specify an array of performance counter to check against.
|
||||||
|
.INPUTS
|
||||||
|
System.String
|
||||||
|
.OUTPUTS
|
||||||
|
System.String
|
||||||
|
.LINK
|
||||||
|
https://github.com/LordHepipud/icinga-module-windows
|
||||||
|
.NOTES
|
||||||
|
#>
|
||||||
|
|
||||||
function Invoke-IcingaCheckPerfcounter()
|
function Invoke-IcingaCheckPerfcounter()
|
||||||
{
|
{
|
||||||
param(
|
param(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue