2019-07-18 11:54:39 -04:00
|
|
|
<#
|
|
|
|
|
# This script will provide 'Enums' we can use within our module to
|
|
|
|
|
# easier access constants and to maintain a better overview of the
|
|
|
|
|
# entire components
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
[hashtable]$IcingaExitCode = @{
|
|
|
|
|
Ok = 0;
|
|
|
|
|
Warning = 1;
|
|
|
|
|
Critical = 2;
|
|
|
|
|
Unknown = 3;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[hashtable]$IcingaExitCodeText = @{
|
2019-08-22 04:43:00 -04:00
|
|
|
0 = '[OK]';
|
|
|
|
|
1 = '[WARNING]';
|
|
|
|
|
2 = '[CRITICAL]';
|
|
|
|
|
3 = '[UNKNOWN]';
|
2019-07-18 11:54:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[hashtable]$IcingaMeasurementUnits = @{
|
|
|
|
|
's' = 'seconds';
|
|
|
|
|
'ms' = 'milliseconds';
|
|
|
|
|
'us' = 'microseconds';
|
|
|
|
|
'%' = 'percent';
|
|
|
|
|
'B' = 'bytes';
|
2020-02-04 03:33:27 -05:00
|
|
|
'KB' = 'Kilobytes';
|
|
|
|
|
'MB' = 'Megabytes';
|
|
|
|
|
'GB' = 'Gigabytes';
|
|
|
|
|
'TB' = 'Terabytes';
|
2019-07-18 11:54:39 -04:00
|
|
|
'c' = 'counter';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
<#
|
|
|
|
|
# Once we defined a new enum hashtable above, simply add it to this list
|
|
|
|
|
# to make it available within the entire module.
|
|
|
|
|
#
|
|
|
|
|
# Example usage:
|
|
|
|
|
# $IcingaEnums.IcingaExitCode.Ok
|
|
|
|
|
#>
|
|
|
|
|
[hashtable]$IcingaEnums = @{
|
|
|
|
|
IcingaExitCode = $IcingaExitCode;
|
|
|
|
|
IcingaExitCodeText = $IcingaExitCodeText;
|
|
|
|
|
IcingaMeasurementUnits = $IcingaMeasurementUnits;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Export-ModuleMember -Variable @( 'IcingaEnums' );
|