Change New-Icinga-Setup Cmdlet to Install-Icinga

Fixes #3 to follow PS guidelines for Cmdlets
This commit is contained in:
LordHepipud 2018-12-06 18:21:55 +01:00
parent d515b22255
commit d2c9ef9b5b
5 changed files with 12 additions and 12 deletions

View file

@ -37,7 +37,7 @@
};
[hashtable]$ServiceStatus = @{
'NotInstalled' = 'The Icinga service for this module is not installed. Please run New-Icinga-Setup to install the service.';
'NotInstalled' = 'The Icinga service for this module is not installed. Please run Install-Icinga to install the service.';
'Running' = 'The Icinga service is running.';
'Stopped' = 'The Icinga service is not running.';
'Starting' = 'The Icinga service is about to start.';

View file

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

View file

@ -35,7 +35,7 @@ Configure the module
Once the module is installed, you will want to run the initial setup. Therefor you will simply have to type in the command
```powershell
New-Icinga-Setup
Install-Icinga
```
This will create the base configuration of the module including the setup of directories and required files within the **PowerShell Module Directory**.

View file

@ -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', 'New-Icinga-Setup', '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', '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' )
# 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 = @()

View file

@ -4,12 +4,12 @@
.DESCRIPTION
More Information on https://github.com/LordHepipud/icinga-module-windows
.EXAMPLE
New-Icinga-Setup
Install-Icinga
.NOTES
#>
function New-Icinga-Setup()
function Install-Icinga()
{
[string]$command = Get-Icinga-Command('setup');
return &$command;
@ -65,7 +65,7 @@ function Start-Icinga-Daemon
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}
@ -82,7 +82,7 @@ function Stop-Icinga-Daemon()
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}
@ -100,7 +100,7 @@ function Start-Icinga-Checker
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}
@ -117,7 +117,7 @@ function Stop-Icinga-Checker
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}
@ -156,7 +156,7 @@ function New-Icinga-Monitoring()
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}
@ -197,7 +197,7 @@ function Get-Icinga-Counter()
if ((Get-Icinga-Setup) -eq $FALSE) {
$Icinga2.Log.Write(
$Icinga2.Enums.LogState.Warning,
'The agent seems to be not configured on this system. Please run "New-Icinga-Setup" and try again.'
'The agent seems to be not configured on this system. Please run "Install-Icinga" and try again.'
);
return;
}