From bfc015f9646f0b2e6e8ae6a22d54a59f0d4b3057 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sat, 5 Oct 2019 21:52:49 +0200 Subject: [PATCH] Added Cmdlet for fetching config directory --- core/init.ps1 | 1 + icinga-module-windows.psd1 | 2 +- icinga-module-windows.psm1 | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/init.ps1 b/core/init.ps1 index f8e41da..ac4b829 100644 --- a/core/init.ps1 +++ b/core/init.ps1 @@ -11,6 +11,7 @@ Set-Variable -Name Icinga2 -Option Constant -Value @{ 'Import-IcingaLib', 'Get-IcingaPluginDir', 'Get-IcingaCacheDir', + 'Get-IcingaPowerShellConfigDir', 'Get-Icinga-Lib', 'Get-Icinga-Object', 'Get-Icinga-Service', diff --git a/icinga-module-windows.psd1 b/icinga-module-windows.psd1 index c1e1e85..3ae95d2 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 = @( 'Use-Icinga', 'Import-IcingaLib', 'Get-IcingaPluginDir', 'Get-IcingaCacheDir', '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' ) +FunctionsToExport = @( 'Use-Icinga', 'Import-IcingaLib', 'Get-IcingaPluginDir', 'Get-IcingaCacheDir', 'Get-IcingaPowerShellConfigDir', '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 a03a454..be3c8e3 100644 --- a/icinga-module-windows.psm1 +++ b/icinga-module-windows.psm1 @@ -84,6 +84,12 @@ function Get-IcingaCacheDir() { return (Join-Path -Path $PSScriptRoot -ChildPath 'cache'); } + +function Get-IcingaPowerShellConfigDir() +{ + return (Join-Path -Path $PSScriptRoot -ChildPath 'config'); +} + function Install-Icinga() { [string]$command = Get-Icinga-Command('setup');