From e42dc426253d549dc04b772342cd84ac777780cf Mon Sep 17 00:00:00 2001 From: CoreidCC Date: Mon, 23 Sep 2024 19:14:32 +0200 Subject: [PATCH] fix check_mk_agent.openbsd multi network interfaces support current behaviour: the script work well if there is only one network interface configured but as soon as more then one network interface exists the reports just garbage. the cause: seeting IFS to '' will skip any substitution resulting in for loop only executing once (the list to iterate over just consists of a single value) solution: set IFS to only contain a newline --- agents/check_mk_agent.openbsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agents/check_mk_agent.openbsd b/agents/check_mk_agent.openbsd index 68667091f0a..2b01ab8d1a9 100755 --- a/agents/check_mk_agent.openbsd +++ b/agents/check_mk_agent.openbsd @@ -181,7 +181,7 @@ section_misc_sections() { # adjust internal field separator to get lines from netstat and backup it before OFS=$IFS - IFS='' + IFS=$(echo -n "\n\b") # collect netstat values and interface number for NS in $NETSTAT_OUTPUT; do