From 27c2cb85180413a013491a36ef3a58e6447fe64c Mon Sep 17 00:00:00 2001 From: LordHepipud Date: Thu, 6 Dec 2018 18:28:56 +0100 Subject: [PATCH] Changed name for New/Remove-Icinga-Service Cmdlet Fixes #8 which adds a proper naming for installing / uninstalling the Icinga Service for the PowerShell module --- core/init.ps1 | 4 ++-- doc/10-InstallService.md | 4 ++-- icinga-module-windows.psd1 | 2 +- icinga-module-windows.psm1 | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/init.ps1 b/core/init.ps1 index 323b3e7..e97ce2e 100644 --- a/core/init.ps1 +++ b/core/init.ps1 @@ -13,8 +13,8 @@ Set-Variable -Name Icinga2 -Option Constant -Value @{ 'Start-Icinga-Service', 'Stop-Icinga-Service', 'Restart-Icinga-Service', - 'New-Icinga-Service', - 'Remove-Icinga-Service', + 'Install-Icinga-Service', + 'Uninstall-Icinga-Service', 'Install-Icinga', 'Get-Icinga-Setup', 'Start-Icinga-Daemon', diff --git a/doc/10-InstallService.md b/doc/10-InstallService.md index 4604fff..5ca4cab 100644 --- a/doc/10-InstallService.md +++ b/doc/10-InstallService.md @@ -30,7 +30,7 @@ and the binary name is Now lets install the service with the help of the PowerShell Module: ```powershell - New-Icinga-Service -IcingaServicePath 'C:\Program Files\Icinga Windows Service\icinga-service.exe' + Install-Icinga-Service -IcingaServicePath 'C:\Program Files\Icinga Windows Service\icinga-service.exe' ``` You can validate if the service has been installed properly by using the Get Service Cmdlet: @@ -44,6 +44,6 @@ Of course there are more Cmdlets available, making the management of this Icinga * Start-Icinga-Service * Stop-Icinga-Service * Restart-Icinga-Service -* Remove-Icinga-Service +* Uninstall-Icinga-Service **Note:** If you run the PowerShell Module as service, both the Daemon and Checker component will be started. To prevent external access to the Daemon, you should ensure to block port **5891** on this host. \ No newline at end of file diff --git a/icinga-module-windows.psd1 b/icinga-module-windows.psd1 index 513bdcd..c3b2ac9 100644 --- a/icinga-module-windows.psd1 +++ b/icinga-module-windows.psd1 @@ -25,7 +25,7 @@ Description = 'Icinga 2 Windows Agent Module, which allows to entirely monitor t PowerShellVersion = '3.0' # Aus diesem Modul zu exportierende Funktionen. Um optimale Leistung zu erzielen, verwenden Sie keine Platzhalter und löschen den Eintrag nicht. Verwenden Sie ein leeres Array, wenn keine zu exportierenden Funktionen vorhanden sind. -FunctionsToExport = @( 'Start-Icinga-Checker', 'Stop-Icinga-Checker', 'Get-Icinga-Lib', 'Get-Icinga-Object', 'Get-Icinga-Service', 'Start-Icinga-Service', 'Stop-Icinga-Service', 'Restart-Icinga-Service', 'New-Icinga-Service', 'Remove-Icinga-Service', 'Get-Icinga-Setup', 'Install-Icinga', 'Start-Icinga-Daemon', 'Stop-Icinga-Daemon', 'Icinga-Client', 'Get-Icinga-Command', 'New-Icinga-Monitoring', 'Get-Icinga-Counter', 'Get-Icinga-Config', 'Set-Icinga-Config', 'Remove-Icinga-Config', 'New-Icinga-Config' ) +FunctionsToExport = @( 'Start-Icinga-Checker', 'Stop-Icinga-Checker', 'Get-Icinga-Lib', 'Get-Icinga-Object', 'Get-Icinga-Service', 'Start-Icinga-Service', 'Stop-Icinga-Service', 'Restart-Icinga-Service', 'Install-Icinga-Service', 'Uninstall-Icinga-Service', 'Get-Icinga-Setup', 'Install-Icinga', 'Start-Icinga-Daemon', 'Stop-Icinga-Daemon', 'Icinga-Client', 'Get-Icinga-Command', 'New-Icinga-Monitoring', 'Get-Icinga-Counter', 'Get-Icinga-Config', 'Set-Icinga-Config', 'Remove-Icinga-Config', 'New-Icinga-Config' ) # Aus diesem Modul zu exportierende Cmdlets. Um optimale Leistung zu erzielen, verwenden Sie keine Plat'zhalter und löschen den Eintrag nicht. Verwenden Sie ein leeres Array, wenn keine zu exportierenden Cmdlets vorhanden sind. CmdletsToExport = @() diff --git a/icinga-module-windows.psm1 b/icinga-module-windows.psm1 index 4595ba1..3d84e5e 100644 --- a/icinga-module-windows.psm1 +++ b/icinga-module-windows.psm1 @@ -41,7 +41,7 @@ function Restart-Icinga-Service() $Icinga2.Service.Restart(); } -function New-Icinga-Service() +function Install-Icinga-Service() { [CmdletBinding()] param( @@ -50,7 +50,7 @@ function New-Icinga-Service() $Icinga2.Service.Install($IcingaServicePath); } -function Remove-Icinga-Service() +function Uninstall-Icinga-Service() { $Icinga2.Service.Uninstall(); }