From 94cd86e1d711aafff6787735b6c4aa81d2994263 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 25 Sep 2020 15:40:20 +0200 Subject: [PATCH] Fix accessing to undefined command & argument vars Although in the command.conf file almost all arguments have been defined with $powershell_*$, but in the example.conf file the arguments and commands are accessed with vars.winrm_*, which do not exist. --- icinga2/command.conf | 2 +- icinga2/example.conf | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/icinga2/command.conf b/icinga2/command.conf index 6b17a3a..37425b2 100644 --- a/icinga2/command.conf +++ b/icinga2/command.conf @@ -1,4 +1,4 @@ -object CheckCommand "winrm" { +object CheckCommand "powershell" { command = [ PluginDir + "/check_by_powershell" ] arguments = { diff --git a/icinga2/example.conf b/icinga2/example.conf index a3fd91a..66b7091 100644 --- a/icinga2/example.conf +++ b/icinga2/example.conf @@ -2,10 +2,10 @@ object Host "windowshost" { import "generic-host" address = "192.168.172.217" - vars.winrm_port = 5985 - vars.winrm_user = "windowsuser" - vars.winrm_password = "secret!pw" - // vars.winrm_insecure = true + vars.powershell_port = 5985 + vars.powershell_user = "windowsuser" + vars.powershell_password = "secret!pw" + // vars.powershell_insecure = true vars.server_type = "windows" } @@ -14,13 +14,13 @@ template Service "powershell-template-service" { import "generic-service" vars.original_check_command = check_command - check_command = "winrm" + check_command = "powershell" - vars.by_winrm_command = {{ get_check_command(service.vars.original_check_command).command }} - vars.by_winrm_arguments = {{ get_check_command(service.vars.original_check_command).arguments }} + vars.by_powershell_command = {{ get_check_command(service.vars.original_check_command).command }} + vars.by_powershell_arguments = {{ get_check_command(service.vars.original_check_command).arguments }} } -apply Service "winrm_check_ntp" { +apply Service "powershell_check_ntp" { check_command = "powershell-checkTime-sync" import "powershell-template-service"