mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Merge pull request #707 from Icinga:fix/ifw_eventlog_size
Fix: Size of Icinga for Windows eventlog Fixes size of the `Icinga for Windows` eventlog by setting it to `20MiB`, allowing to store more events before they are overwritten
This commit is contained in:
commit
98f3f60668
3 changed files with 21 additions and 0 deletions
|
|
@ -11,6 +11,12 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
|
||||
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/32)
|
||||
|
||||
## 1.12.1 (tbd)
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* [#707](https://github.com/Icinga/icinga-powershell-framework/pull/707) Fixes size of the `Icinga for Windows` eventlog by setting it to `20MiB`, allowing to store more events before they are overwritten
|
||||
|
||||
## 1.12.0 (2024-03-26)
|
||||
|
||||
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/28)
|
||||
|
|
|
|||
|
|
@ -100,4 +100,14 @@ function Invoke-IcingaForWindowsMigration()
|
|||
|
||||
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.0');
|
||||
}
|
||||
|
||||
if (Test-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.1')) {
|
||||
Write-IcingaConsoleNotice 'Applying pending migrations required for Icinga for Windows v1.12.1';
|
||||
|
||||
# Fixes the size of the Icinga for Windows Eventlog, allowing more logs to be collected
|
||||
# before older ones are faded out
|
||||
Register-IcingaEventLog;
|
||||
|
||||
Set-IcingaForWindowsMigration -MigrationVersion (New-IcingaVersionObject -Version '1.12.1');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,9 @@ function Register-IcingaEventLog()
|
|||
|
||||
New-EventLog -LogName 'Icinga for Windows' -Source $LogName -ErrorAction SilentlyContinue;
|
||||
}
|
||||
|
||||
$IfWEventLog = Get-WinEvent -ListLog 'Icinga for Windows';
|
||||
# Set the size to 20MiB
|
||||
$IfWEventLog.MaximumSizeInBytes = 20971520;
|
||||
$IfWEventLog.SaveChanges();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue