mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Added support to remove registered service checks
This commit is contained in:
parent
084453e722
commit
ae978b1d7c
1 changed files with 16 additions and 0 deletions
16
lib/daemon/Unregister-IcingaServiceCheck.psm1
Normal file
16
lib/daemon/Unregister-IcingaServiceCheck.psm1
Normal file
|
|
@ -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';
|
||||
}
|
||||
Loading…
Reference in a new issue