From 1f05cc23d1aff08a3c96870280d793de569fbdbd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 13 Feb 2015 12:11:53 +0100 Subject: [PATCH] Wrap IPv6 addresses in udp6:[] for check_snmp refs #8259 --- itl/command-plugins.conf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 1b5f28b44..f0202f1c2 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -718,7 +718,6 @@ object CheckCommand "load" { object CheckCommand "snmp" { import "plugin-check-command" - import "ipv4-or-ipv6" command = [ PluginDir + "/check_snmp" ] @@ -740,7 +739,17 @@ object CheckCommand "snmp" { } } - vars.snmp_address = "$check_address$" + vars.snmp_address = {{ + var addr_v4 = macro("$address$") + var addr_v6 = macro("$address6$") + + if (addr_v4) { + return addr_v4 + } else { + return "udp6:[" + addr_v6 + "]" + } + }} + vars.snmp_community = "public" vars.snmp_invert_search = false vars.snmp_timeout = "10" -- 2.40.0