Adds support for auto loading third-party module eventlog messages

This commit is contained in:
Christian Stein 2020-03-25 17:53:18 +01:00
parent 2e225e1ce5
commit 483356136c

View file

@ -29,6 +29,15 @@ function Use-Icinga()
Import-IcingaLib '\' -Init -Custom; Import-IcingaLib '\' -Init -Custom;
Import-IcingaLib '\' -Init; Import-IcingaLib '\' -Init;
$EventLogMessages = Invoke-IcingaNamespaceCmdlets -Command 'Register-IcingaEventLogMessages*';
foreach ($entry in $EventLogMessages.Values) {
foreach ($event in $entry.Keys) {
Add-IcingaHashtableItem -Hashtable $global:IcingaEventLogEnums `
-Key $event `
-Value $entry[$event] | Out-Null;
}
}
if ($LibOnly -eq $FALSE) { if ($LibOnly -eq $FALSE) {
Register-IcingaEventLog; Register-IcingaEventLog;