Skip to content

Commit

Permalink
Merge pull request #74 from Icinga:feature/ifw_config_update
Browse files Browse the repository at this point in the history
Feature: Updates config to IfW v1.11.0
  • Loading branch information
LordHepipud authored Nov 2, 2023
2 parents 73e25b6 + 2d9b161 commit ae02210
Show file tree
Hide file tree
Showing 11 changed files with 165 additions and 122 deletions.
2 changes: 1 addition & 1 deletion config/director/Hyperv_Bundle.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/director/Invoke-IcingaCheckHyperVVMHealth.json

Large diffs are not rendered by default.

141 changes: 81 additions & 60 deletions config/icinga/Hyperv_Bundle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVHealth" {
value = "$IcingaCheckHyperVHealth_Object_NodeCountWarning$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervhealth
vars.ifw_api_command = "invoke-icingacheckhypervhealth"
vars.IcingaCheckHyperVHealth_Switchparameter_NoPerfData = false
}

Expand Down Expand Up @@ -164,7 +164,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVDuplicateVM" {
value = "$IcingaCheckHyperVDuplicateVM_Array_ExcludeVMs$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervduplicatevm
vars.ifw_api_command = "invoke-icingacheckhypervduplicatevm"
vars.IcingaCheckHyperVDuplicateVM_Switchparameter_NoPerfData = false
}

Expand Down Expand Up @@ -344,7 +344,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVVirtualSwitches" {
vars.IcingaCheckHyperVVirtualSwitches_Switchparameter_Internal = false
vars.IcingaCheckHyperVVirtualSwitches_Switchparameter_NoPerfData = false
vars.IcingaCheckHyperVVirtualSwitches_Switchparameter_AvoidEmptyCheck = false
vars.ifw_api_command = invoke-icingacheckhypervvirtualswitches
vars.ifw_api_command = "invoke-icingacheckhypervvirtualswitches"
}

object CheckCommand "Invoke-IcingaCheckHyperVSnapshot" {
Expand Down Expand Up @@ -550,7 +550,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVSnapshot" {
}
vars.IcingaCheckHyperVSnapshot_Switchparameter_NoPerfData = false
vars.IcingaCheckHyperVSnapshot_Switchparameter_EmptySnapshotCritical = false
vars.ifw_api_command = invoke-icingacheckhypervsnapshot
vars.ifw_api_command = "invoke-icingacheckhypervsnapshot"
vars.IcingaCheckHyperVSnapshot_Switchparameter_ActiveVms = false
}

Expand Down Expand Up @@ -757,67 +757,35 @@ object CheckCommand "Invoke-IcingaCheckHyperVOverCommitment" {
value = "$IcingaCheckHyperVOverCommitment_Object_StorageOCPercentWarn$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervovercommitment
vars.ifw_api_command = "invoke-icingacheckhypervovercommitment"
vars.IcingaCheckHyperVOverCommitment_Switchparameter_ActiveVms = false
}

object CheckCommand "Invoke-IcingaCheckHyperVVMHealth" {
import "PowerShell Base"

arguments += {
"-C" = {
value = "try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable 'icinga-powershell-*' )`r`n'Module-Path:'`r`n$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckHyperVVMHealth' "
order = 0
}
"-NegateVMState" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_NegateVMState$"
"-SkipVMHeartbeat" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_SkipVMHeartbeat$"
order = 99
}
"-ThresholdInterval" = {
set_if = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_ThresholdInterval$"); if (len(str) == 0) { return false; }; return true;
}}
description = "Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described here: https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/ An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring."
value = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_ThresholdInterval$");
var argLen = len(str);
if (argLen == 0) {
return;
}
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
return str;
}
return ("'" + str + "'");
}}
order = 100
}
"-Verbosity" = {
description = "Changes the behavior of the plugin output which check states are printed: 0 (default): Only service checks/packages with state not OK will be printed 1: Only services with not OK will be printed including OK checks of affected check packages including Package config 2: Everything will be printed regardless of the check state 3: Identical to Verbose 2, but prints in addition the check package configuration e.g (All must be [OK])"
value = "$IcingaCheckHyperVVMHealth_Object_Verbosity$"
order = 7
}
"-CriticalActiveVms" = {
description = "Allows to monitor on how many active VM's are currently present and throws a warning in case it is within the threshold"
value = "$IcingaCheckHyperVVMHealth_Object_CriticalActiveVms$"
order = 5
}
"-VmEnabledState" = {
description = "Critical threshold for the Hyper-V VM current status"
value = "$IcingaCheckHyperVVMHealth_Object_VmEnabledState$"
order = 6
order = 8
}
"-SkipVMHeartbeat" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_SkipVMHeartbeat$"
"-ActiveVms" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_ActiveVms$"
order = 99
}
"-NoPerfData" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_NoPerfData$"
order = 99
}
"-ExcludeVms" = {
description = "Exclude virtual machines with a specific name. Supports wildcard usage (*)"
"-IncludeVms" = {
description = "Include only virtual machines with a specific name. Supports wildcard usage (*)"
value = {{
var arr = macro("$IcingaCheckHyperVVMHealth_Array_ExcludeVms$");
var arr = macro("$IcingaCheckHyperVVMHealth_Array_IncludeVms$");
if (len(arr) == 0) {
return "@()";
}
Expand All @@ -835,17 +803,21 @@ object CheckCommand "Invoke-IcingaCheckHyperVVMHealth" {
).join(",");
return "@(" + psarr + ")";
}}
order = 3
order = 2
}
"-WarningActiveVms" = {
description = "Allows to monitor on how many active VM's are currently present and throws a warning in case it is within the threshold"
value = "$IcingaCheckHyperVVMHealth_Object_WarningActiveVms$"
order = 4
"-VmEnabledState" = {
description = "Critical threshold for the Hyper-V VM current status"
value = "$IcingaCheckHyperVVMHealth_Object_VmEnabledState$"
order = 7
}
"-IncludeVms" = {
description = "Include only virtual machines with a specific name. Supports wildcard usage (*)"
"-C" = {
value = "try { Use-Icinga -Minimal; } catch { Write-Output 'The Icinga PowerShell Framework is either not installed on the system or not configured properly. Please check https://icinga.com/docs/windows for further details'; Write-Output 'Error:' $$($$_.Exception.Message)Components:`r`n$$( Get-Module -ListAvailable 'icinga-powershell-*' )`r`n'Module-Path:'`r`n$$($$Env:PSModulePath); exit 3; }; Exit-IcingaExecutePlugin -Command 'Invoke-IcingaCheckHyperVVMHealth' "
order = 0
}
"-ExcludeVms" = {
description = "Exclude virtual machines with a specific name. Supports wildcard usage (*)"
value = {{
var arr = macro("$IcingaCheckHyperVVMHealth_Array_IncludeVms$");
var arr = macro("$IcingaCheckHyperVVMHealth_Array_ExcludeVms$");
if (len(arr) == 0) {
return "@()";
}
Expand All @@ -863,14 +835,63 @@ object CheckCommand "Invoke-IcingaCheckHyperVVMHealth" {
).join(",");
return "@(" + psarr + ")";
}}
order = 2
order = 3
}
"-ActiveVms" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_ActiveVms$"
"-BlackoutTimesEventDelta" = {
set_if = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_BlackoutTimesEventDelta$"); if (len(str) == 0) { return false; }; return true;
}}
description = "Defines a time range (example '-5d') to filter for any BlackoutTime log entries older than the provided time range. In case a warning BlackoutTime is triggered and older than the provided threshold, the value is printed with an 'OK' state instead of 'WARNING'"
value = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_BlackoutTimesEventDelta$");
var argLen = len(str);
if (argLen == 0) {
return;
}
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
return str;
}
return ("'" + str + "'");
}}
order = 6
}
"-ThresholdInterval" = {
set_if = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_ThresholdInterval$"); if (len(str) == 0) { return false; }; return true;
}}
description = "Change the value your defined threshold checks against from the current value to a collected time threshold of the Icinga for Windows daemon, as described here: https://icinga.com/docs/icinga-for-windows/latest/doc/service/10-Register-Service-Checks/ An example for this argument would be 1m or 15m which will use the average of 1m or 15m for monitoring."
value = {{
var str = macro("$IcingaCheckHyperVVMHealth_String_ThresholdInterval$");
var argLen = len(str);
if (argLen == 0) {
return;
}
if (argLen != 0 && str.substr(0,1) == "'" && str.substr(argLen - 1, argLen) == "'") {
return str;
}
return ("'" + str + "'");
}}
order = 100
}
"-WarningActiveVms" = {
description = "Allows to monitor on how many active VM's are currently present and throws a warning in case it is within the threshold"
value = "$IcingaCheckHyperVVMHealth_Object_WarningActiveVms$"
order = 4
}
"-CriticalActiveVms" = {
description = "Allows to monitor on how many active VM's are currently present and throws a warning in case it is within the threshold"
value = "$IcingaCheckHyperVVMHealth_Object_CriticalActiveVms$"
order = 5
}
"-NegateVMState" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_NegateVMState$"
order = 99
}
}
vars.ifw_api_arguments = {
"SkipVMHeartbeat" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_SkipVMHeartbeat$"
}
"ThresholdInterval" = {
value = "$IcingaCheckHyperVVMHealth_String_ThresholdInterval$"
}
Expand All @@ -889,8 +910,8 @@ object CheckCommand "Invoke-IcingaCheckHyperVVMHealth" {
"VmEnabledState" = {
value = "$IcingaCheckHyperVVMHealth_Object_VmEnabledState$"
}
"SkipVMHeartbeat" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_SkipVMHeartbeat$"
"BlackoutTimesEventDelta" = {
value = "$IcingaCheckHyperVVMHealth_String_BlackoutTimesEventDelta$"
}
"NoPerfData" = {
set_if = "$IcingaCheckHyperVVMHealth_Switchparameter_NoPerfData$"
Expand All @@ -908,7 +929,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVVMHealth" {
vars.IcingaCheckHyperVVMHealth_Switchparameter_ActiveVms = false
vars.IcingaCheckHyperVVMHealth_Switchparameter_NoPerfData = false
vars.IcingaCheckHyperVVMHealth_Switchparameter_SkipVMHeartbeat = false
vars.ifw_api_command = invoke-icingacheckhypervvmhealth
vars.ifw_api_command = "invoke-icingacheckhypervvmhealth"
vars.IcingaCheckHyperVVMHealth_Switchparameter_NegateVMState = false
}

Expand Down Expand Up @@ -1088,7 +1109,7 @@ object CheckCommand "Invoke-IcingaCheckHyperVVMM" {
value = "$IcingaCheckHyperVVMM_Object_Verbosity$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervvmm
vars.ifw_api_command = "invoke-icingacheckhypervvmm"
}


2 changes: 1 addition & 1 deletion config/icinga/Invoke-IcingaCheckHyperVDuplicateVM.conf
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ object CheckCommand "Invoke-IcingaCheckHyperVDuplicateVM" {
value = "$IcingaCheckHyperVDuplicateVM_Array_ExcludeVMs$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervduplicatevm
vars.ifw_api_command = "invoke-icingacheckhypervduplicatevm"
vars.IcingaCheckHyperVDuplicateVM_Switchparameter_NoPerfData = false
}
2 changes: 1 addition & 1 deletion config/icinga/Invoke-IcingaCheckHyperVHealth.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ object CheckCommand "Invoke-IcingaCheckHyperVHealth" {
value = "$IcingaCheckHyperVHealth_Object_NodeCountWarning$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervhealth
vars.ifw_api_command = "invoke-icingacheckhypervhealth"
vars.IcingaCheckHyperVHealth_Switchparameter_NoPerfData = false
}
2 changes: 1 addition & 1 deletion config/icinga/Invoke-IcingaCheckHyperVOverCommitment.conf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ object CheckCommand "Invoke-IcingaCheckHyperVOverCommitment" {
value = "$IcingaCheckHyperVOverCommitment_Object_StorageOCPercentWarn$"
}
}
vars.ifw_api_command = invoke-icingacheckhypervovercommitment
vars.ifw_api_command = "invoke-icingacheckhypervovercommitment"
vars.IcingaCheckHyperVOverCommitment_Switchparameter_ActiveVms = false
}
2 changes: 1 addition & 1 deletion config/icinga/Invoke-IcingaCheckHyperVSnapshot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,6 @@ object CheckCommand "Invoke-IcingaCheckHyperVSnapshot" {
}
vars.IcingaCheckHyperVSnapshot_Switchparameter_NoPerfData = false
vars.IcingaCheckHyperVSnapshot_Switchparameter_EmptySnapshotCritical = false
vars.ifw_api_command = invoke-icingacheckhypervsnapshot
vars.ifw_api_command = "invoke-icingacheckhypervsnapshot"
vars.IcingaCheckHyperVSnapshot_Switchparameter_ActiveVms = false
}
Loading

0 comments on commit ae02210

Please sign in to comment.