Mk_oracle plugin problem

I have now been able to fix the problem locally by setting MK_ORA_DEBUG=true in /usr/lib/check_mk_agents/plugins/mk_oracle. After that change the cache file is created correctly and updated every CACHE_MAXAGE. After looking into the plugin i found that MK_ORA_DEBUG is used only once where the cache file is generated, so i suspect the problem must be there in the if then else fi statement.

    # Cache file outdated and new job not yet running? Start it
    if [ -z "$use_cache_file" ] && [ ! -e "${cache_file}.new" ]; then
        if $MK_ORA_DEBUG; then
            echo "set -o noclobber; exec > \"${cache_file}.new\" || exit 1; ${cmd_name} && mv \"${cache_file}.new\" \"${cache_file}\" || rm -f \"${cache_file}\" \"${cache_file}.new\"" | /bin/bash
        else
            # When the command fails, the output is throws away ignored
            echo "set -o noclobber; exec > \"${cache_file}.new\" || exit 1; ${cmd_name} && mv \"${cache_file}.new\" \"${cache_file}\" || rm -f \"${cache_file}\" \"${cache_file}.new\"" | nohup /bin/bash >/dev/null 2>&1 &
        fi
    fi
1 Like