diff --git a/lib/daemon/Unregister-IcingaServiceCheck.psm1 b/lib/daemon/Unregister-IcingaServiceCheck.psm1 new file mode 100644 index 0000000..9285a11 --- /dev/null +++ b/lib/daemon/Unregister-IcingaServiceCheck.psm1 @@ -0,0 +1,16 @@ +function Unregister-IcingaServiceCheck() +{ + param( + [string]$ServiceId + ); + + if ([string]::IsNullOrEmpty($ServiceId)) { + throw 'Please specify a Service Id'; + } + + $Path = [string]::Format('BackgroundDaemon.RegisteredServices.{0}', $ServiceId); + + Remove-IcingaPowerShellConfig -Path $Path; + + Write-Host 'Icinga Service Check has been configured'; +}