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
This commit is contained in:
LordHepipud 2018-12-06 18:28:56 +01:00
parent d2c9ef9b5b
commit 27c2cb8518
4 changed files with 7 additions and 7 deletions

View file

@ -13,8 +13,8 @@ Set-Variable -Name Icinga2 -Option Constant -Value @{
'Start-Icinga-Service', 'Start-Icinga-Service',
'Stop-Icinga-Service', 'Stop-Icinga-Service',
'Restart-Icinga-Service', 'Restart-Icinga-Service',
'New-Icinga-Service', 'Install-Icinga-Service',
'Remove-Icinga-Service', 'Uninstall-Icinga-Service',
'Install-Icinga', 'Install-Icinga',
'Get-Icinga-Setup', 'Get-Icinga-Setup',
'Start-Icinga-Daemon', 'Start-Icinga-Daemon',

View file

@ -30,7 +30,7 @@ and the binary name is
Now lets install the service with the help of the PowerShell Module: Now lets install the service with the help of the PowerShell Module:
```powershell ```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: 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 * Start-Icinga-Service
* Stop-Icinga-Service * Stop-Icinga-Service
* Restart-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. **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.

View file

@ -25,7 +25,7 @@ Description = 'Icinga 2 Windows Agent Module, which allows to entirely monitor t
PowerShellVersion = '3.0' 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. # 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. # 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 = @() CmdletsToExport = @()

View file

@ -41,7 +41,7 @@ function Restart-Icinga-Service()
$Icinga2.Service.Restart(); $Icinga2.Service.Restart();
} }
function New-Icinga-Service() function Install-Icinga-Service()
{ {
[CmdletBinding()] [CmdletBinding()]
param( param(
@ -50,7 +50,7 @@ function New-Icinga-Service()
$Icinga2.Service.Install($IcingaServicePath); $Icinga2.Service.Install($IcingaServicePath);
} }
function Remove-Icinga-Service() function Uninstall-Icinga-Service()
{ {
$Icinga2.Service.Uninstall(); $Icinga2.Service.Uninstall();
} }