Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/31-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic

## 1.10.1 (2022-12-20)

### Bugfixes

* [#323](https://github.com/Icinga/icinga-powershell-plugins/issues/323) Fixes `Invoke-IcingaCheckService` to write invalid performance data in case one service is actively checked and returning `UNKNOWN` because it does not exist

### Enhancements

* [#322](https://github.com/Icinga/icinga-powershell-plugins/issues/322) Adds flag `-IgnoreService` for plugin `Invoke-IcingaCheckTimeSync` to ignore the time service being evaluated during check runtime
Expand Down
7 changes: 6 additions & 1 deletion plugins/Invoke-IcingaCheckService.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ function Invoke-IcingaCheckService()
}
}

# Fix invalid performance data in case only one service was checked and the service does not exist
if ($null -eq $ServiceSummary) {
$ServiceSummary = Add-IcingaServiceSummary;
}

# Check our included services and add an unknown state for each service which was not found on the system
foreach ($ServiceArg in $Service) {
if ($null -eq $FetchedServices -Or $FetchedServices.ContainsKey($ServiceArg) -eq $FALSE) {
Expand All @@ -163,7 +168,7 @@ function Invoke-IcingaCheckService()
}

$ServicesPackage.AddCheck(
(New-IcingaCheck -Name ([string]::Format('{0}: Service not found', $ServiceArg))).SetUnknown()
(New-IcingaCheck -Name ([string]::Format('{0}: Service not found', $ServiceArg)) -NoPerfData).SetUnknown()
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion provider/private/services/Add-IcingaServiceSummary.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Add-IcingaServiceSummary()
}
}

switch($ServiceStatus) {
switch ($ServiceStatus) {
$ProviderEnums.ServiceStatus.Stopped {
$ServiceData.StoppedCount += 1;
};
Expand Down