mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Change New-Icinga-Setup Cmdlet to Install-Icinga
Fixes #3 to follow PS guidelines for Cmdlets
This commit is contained in:
parent
d515b22255
commit
d2c9ef9b5b
5 changed files with 12 additions and 12 deletions
|
|
@ -37,7 +37,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
[hashtable]$ServiceStatus = @{
|
[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.';
|
'Running' = 'The Icinga service is running.';
|
||||||
'Stopped' = 'The Icinga service is not running.';
|
'Stopped' = 'The Icinga service is not running.';
|
||||||
'Starting' = 'The Icinga service is about to start.';
|
'Starting' = 'The Icinga service is about to start.';
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ Set-Variable -Name Icinga2 -Option Constant -Value @{
|
||||||
'Restart-Icinga-Service',
|
'Restart-Icinga-Service',
|
||||||
'New-Icinga-Service',
|
'New-Icinga-Service',
|
||||||
'Remove-Icinga-Service',
|
'Remove-Icinga-Service',
|
||||||
'New-Icinga-Setup',
|
'Install-Icinga',
|
||||||
'Get-Icinga-Setup',
|
'Get-Icinga-Setup',
|
||||||
'Start-Icinga-Daemon',
|
'Start-Icinga-Daemon',
|
||||||
'Stop-Icinga-Daemon',
|
'Stop-Icinga-Daemon',
|
||||||
|
|
|
||||||
|
|
@ -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
|
Once the module is installed, you will want to run the initial setup. Therefor you will simply have to type in the command
|
||||||
|
|
||||||
```powershell
|
```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**.
|
This will create the base configuration of the module including the setup of directories and required files within the **PowerShell Module Directory**.
|
||||||
|
|
|
||||||
|
|
@ -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', '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.
|
# 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 = @()
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
More Information on https://github.com/LordHepipud/icinga-module-windows
|
More Information on https://github.com/LordHepipud/icinga-module-windows
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
New-Icinga-Setup
|
Install-Icinga
|
||||||
.NOTES
|
.NOTES
|
||||||
|
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function New-Icinga-Setup()
|
function Install-Icinga()
|
||||||
{
|
{
|
||||||
[string]$command = Get-Icinga-Command('setup');
|
[string]$command = Get-Icinga-Command('setup');
|
||||||
return &$command;
|
return &$command;
|
||||||
|
|
@ -65,7 +65,7 @@ function Start-Icinga-Daemon
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +82,7 @@ function Stop-Icinga-Daemon()
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -100,7 +100,7 @@ function Start-Icinga-Checker
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -117,7 +117,7 @@ function Stop-Icinga-Checker
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -156,7 +156,7 @@ function New-Icinga-Monitoring()
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -197,7 +197,7 @@ function Get-Icinga-Counter()
|
||||||
if ((Get-Icinga-Setup) -eq $FALSE) {
|
if ((Get-Icinga-Setup) -eq $FALSE) {
|
||||||
$Icinga2.Log.Write(
|
$Icinga2.Log.Write(
|
||||||
$Icinga2.Enums.LogState.Warning,
|
$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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue