mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 15:19:58 -05:00
25 lines
631 B
PowerShell
25 lines
631 B
PowerShell
|
|
function Write-IcingaEventMessage()
|
||
|
|
{
|
||
|
|
param(
|
||
|
|
[int]$EventId = 0,
|
||
|
|
[string]$Namespace = $null
|
||
|
|
);
|
||
|
|
|
||
|
|
if ($EventId -eq 0 -Or $null -eq $Namespace) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
$EntryType = $IcingaEventLogEnums[$Namespace][$EventId].EntryType;
|
||
|
|
$Message = $IcingaEventLogEnums[$Namespace][$EventId].Message;
|
||
|
|
|
||
|
|
if ($null -eq $EntryType -Or $null -eq $Message) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-EventLog -LogName Application `
|
||
|
|
-Source 'Icinga for Windows' `
|
||
|
|
-EntryType $EntryType `
|
||
|
|
-EventId $EventId `
|
||
|
|
-Message $Message;
|
||
|
|
}
|