diff --git a/.werks/17480.md b/.werks/17480.md new file mode 100644 index 00000000000..91884811e67 --- /dev/null +++ b/.werks/17480.md @@ -0,0 +1,16 @@ +[//]: # (werk v2) +# Fix empty output from mk_db2 agent + +key | value +---------- | --- +date | 2024-12-11T13:55:20+00:00 +version | 2.3.0p23 +class | fix +edition | cre +component | checks +level | 1 +compatible | yes + +The `mk_db2.aix` agent plugin generated empty output for AIX 7.2. + +This fix resolves the issue. diff --git a/agents/plugins/mk_db2.aix b/agents/plugins/mk_db2.aix index 85dbaefc6db..f31ee0b195a 100755 --- a/agents/plugins/mk_db2.aix +++ b/agents/plugins/mk_db2.aix @@ -1,4 +1,4 @@ -#!/usr/bin/ksh +#!/usr/bin/ksh93 # Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. @@ -65,11 +65,11 @@ function waitmax { function query_instance { INSTANCE=$1 # find home directory - HOMEDIR=$(grep "^$INSTANCE" /etc/passwd | awk -F: '{print $6}' | grep "$INSTANCE$") + HOMEDIR=$(grep -w "^$INSTANCE:" /etc/passwd | awk -F: '{print $6}') NOW=$(perl -e "print time();") waitmax 200 < /dev/null; - if [ $? -nq 0 ] ; then + if [ $? -ne 0 ] ; then exit 1 fi