CheckMK Agent on Xen don't quit

Hey guys
I have an issue on a Xen Server - the check_mk agent don’t “quit at the end”.

For example - if I do an “check_mk_agent” on the machine itself, normaly at the last output I see the shell again ([09:54 hostname ~]$). But here I don’t - the agent hangs.

With this I’m not able to do an “cmk -vv --debug” or get any output in Wato. I tried to restart the agent, but nothing worked for me.

Any ideas what I can do instead of an reboot?

Greetz

If you call the agent manually is there any output?

Start the agent with check_mk_agent -d and you see exactly where it hangs.

Thank you for your answer:

-Yes I got an output
-the output ends at:

+ return
+ for skript in '[1-9]*/*'
+ is_valid_plugin '[1-9]*/*'
+ pattern='\.dpkg-(new|old|temp)$'
+ [[ -f [1-9]*/* ]]
+ false
+ true
+ section_checkmk_failed_plugins
+ failed=("$@")
+ '[' -n '' ']'
+ true
+ '[' -d /var/lib/check_mk_agent/spool ']'
+ '[' -r /var/lib/check_mk_agent/spool ']'
+ pushd /var/lib/check_mk_agent/spool
++ date +%s
+ now=1634026638
+ for file in '*'
+ test '*' = '*'
+ break
+ popd

This is what I got from another machine which is working as expected:

+ return
+ for skript in '[1-9]*/*'
+ is_valid_plugin '[1-9]*/*'
+ pattern='\.dpkg-(new|old|temp)$'
+ [[ -f [1-9]*/* ]]
+ false

section_checkmk_failed_plugins "${FAILED_PYTHON_PLUGINS[@]}"
+ section_checkmk_failed_plugins
+ failed=("$@")
+ '[' -n '' ']'

# Agent output snippets created by cronjobs, etc.
if [ -d "$SPOOLDIR" ] && [ -r "$SPOOLDIR" ]; then
    pushd "$SPOOLDIR" >/dev/null
    now=$(date +%s)

    for file in *; do
        test "$file" = "*" && break
        # output every file in this directory. If the file is prefixed
        # with a number, then that number is the maximum age of the
        # file in seconds. If the file is older than that, it is ignored.
        maxage=""
        part="$file"

        # Each away all digits from the front of the filename and
        # collect them in the variable maxage.
        while [ "${part/#[0-9]/}" != "$part" ]; do
            maxage=$maxage${part:0:1}
            part=${part:1}
        done

        # If there is at least one digit, than we honor that.
        if [ "$maxage" ]; then
            mtime=$(stat -c %Y "$file")
            if [ $((now - mtime)) -gt "$maxage" ]; then
                continue
            fi
        fi

        # Output the file
        cat "$file"
    done
    popd >/dev/null
fi
+ '[' -d /var/lib/check_mk_agent/spool ']'
+ '[' -r /var/lib/check_mk_agent/spool ']'
+ pushd /var/lib/check_mk_agent/spool
++ date +%s
+ now=1634026697
+ for file in '*'
+ test '*' = '*'
+ break
+ popd

What version is that agent?

Do you have encryption activated for the agent output?

No encryption set (just the allowed IPs) and it’s the newest agent 2.0.0p12-1. I had the issue as well with the agent 2.0.0p6-1 - so I upgraded this morning with no positive change.

Edit:
Thank you for you help - I restarted the server and the Agent is running again normally.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.