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
65d80118bb
commit
401d08f66f
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()
|
||||
{
|
||||
param(
|
||||
|
|
@ -22,6 +38,22 @@ function ConvertTo-Byte()
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
@ -46,6 +78,22 @@ function ConvertTo-KiloByte()
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
@ -70,6 +118,22 @@ function ConvertTo-MegaByte()
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
@ -94,6 +158,22 @@ function ConvertTo-GigaByte()
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
@ -118,6 +198,22 @@ function ConvertTo-TeraByte()
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,26 @@
|
|||
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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
return $number -Match "^[\d\.]+$";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,61 @@
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,39 @@
|
|||
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()
|
||||
{
|
||||
param(
|
||||
|
|
|
|||
Loading…
Reference in a new issue