Bug Fix Request: check_mk_agent.openwrt Agent Fails To Collect <<<df>>> Services On OpenWrt devices when waitmax is unavailable

I’m running checkmk version 2.5.0p15 installed in a Proxmox LXC container using a Proxmox Community Script.

When I install the openwrt agent bundled with checkmk from Setup > Agents > Other operating systems > Agents > check_mk_agent.openwrt onto a TP-Link Archer C7 V2 device running OpenWrt Version 25.12.5, no Filesystem services are listed at Monitor > Overview > All hosts > hostname > Services for the host.

On inspecting check_mk_agent.openwrt, the <<<df>>> services are collected by the following code:

section_df() {
    # Print out Partitions / Filesystems. (-P gives non-wrapped POSIXed output)
    # Note: BusyBox df does not support -x and -l as arguments
    # If you add a IS_DOCKERIZED check here please inform the kubernetes team
    # who uses this agent without modifications. They expect it to be run
    # without docker detection.
    
    if ! inpath waitmax; then
        return
    fi
    
    echo '<<<df>>>'
    waitmax -s 9 5 df -kPT
     
    # df inodes information
    if waitmax -s 9 5 df -i >/dev/null 2>&1; then
        echo '<<<df>>>'
        echo '[df_inodes_start]'
        waitmax -s 9 5 df -PTi
        echo '[df_inodes_end]'
    fi
    
}

Running the check_mk_agent.openwrt agent remotely via SSH on the OpenWrt device reveals that the <<df>> information is not being collected.

user@hostname:~$ ssh root@xxx.xxx.xxx.xxx /usr/bin/check_mk_agent |
  awk '/^<<<df>>>$/ { show=1; print; next }
       /^<<</      { if (show) exit }
       show'
user@hostname:~$

Upon further investigation, waitmax is not installed on the OpenWrt device and section_df() returns before echoing the df section.

The Openwrt 25.12.5 device has the following busybox package and waitmax is not installed:

apk list --installed | grep -E '^busybox'
busybox-1.37.0-r6 mips_24kc {feeds/base/utils/busybox} (GPL-2.0) [installed]

root@hostname:~# waitmax
-ash: waitmax: not found

To perform a diagnostic test, I modified the section_df() to remove the waitmax references, and comments for brevity, to confirm that the missing waitmax is the root cause (note this code also removes the waitmax timeout protection), yielding:

section_df() {
    # filesystem disk usage information
    echo '<<<df>>>'
    df -kPT

    # df inodes information
    if df -i >/dev/null 2>&1; then
        echo '<<<df>>>'
        echo '[df_inodes_start]'
        df -PTi
        echo '[df_inodes_end]'
    fi
}

Running the modified check_mk_agent.openwrt agent, without the waitmax code, remotely via SSH on the OpenWrt device, yields:

ssh root@xxx.xxx.xxx.xxx /usr/bin/check_mk_agent |
  awk '/^<<<df>>>$/ { show=1; print; next }
       /^<<</      { if (show) exit }
       show'
<<<df>>>
Filesystem           Type       1024-blocks    Used Available Capacity Mounted on
/dev/root            squashfs        5120      5120         0 100% /rom
tmpfs                tmpfs          60364      1948     58416   3% /tmp
/dev/mtdblock4       jffs2           8448      8144       304  96% /overlay
overlayfs:/overlay   overlay         8448      8144       304  96% /
tmpfs                tmpfs            512         0       512   0% /dev

This modified agent now correctly reports the following Filesystem services at Monitor > Overview > All hosts > hostname > Services for the host:

  • Filesystem /
  • Filesystem /overlay
  • Filesystem /rom

I also have an older OpenWrt Version 23.05.5 device with the Busybox version 1.36.1 package, which also does not have waitmax installed.

root@hostname:~# opkg list-installed | grep '^busybox'
busybox - 1.36.1-1
root@hostname:~# waitmax
-ash: waitmax: not found

So waitmax is not installed on both the OpenWrt 25.12.5 and OpenWrt 23.05.5 systems.

Is there an alternative that can be used to implement the waitmax timeout behavior for OpenWrt systems that do not have waitmax installed?

I’m posting this bug fix request here, as I was unable to determine how or where to submit a bug fix request for an agent.

Any guidance would be appreciated.

Two days ago @fabianswebworld posted a new version of the busybox agent.

You should test if this is working correctly on your device.

I’d be happy to hear feedback if that works on the openwrt, but note that my updated agent actually tries to use waitmax if the built-in “timeout” command fails or has an unsupported/non-standard parameter order. So deploying the waitmax from the checkmk linux package alongside this agent script is actually recommended, however it probably won’t work for you as your device doesn’t use the x86_64 architecture, which the pre-compiled binary is compiled for.

Let me know if it works for you, but if it doesn’t, we can figure out if we can somehow also adapt it to the df / timeout command syntaxes available on your device, so that there’s no dependency to x86 waitmax anymore.

Best regards,
Fabian

I would vote for an updated Openwrt version because of it’s size and focus on OpenWrt available services only.

Unfortunatley, as the author states in the comments, this is a fork of the vanilla linux agent, which assumes a Bash environment for features like ps -o and export -f, which are unavailable in OpenWrt ash implementations.

So running this agent on a OpenWrt device fails to produce any output, see below:

root@hostname:~# sh -x /usr/bin/check_mk_agent.busybox --debug
+ MK_DEFINE_LOG_SECTION_TIME='_log_section_time() { "$@"; }'
+ inpath timeout
+ command -v timeout
+ inpath waitmax
+ command -v waitmax
+ '[' -n  ]
+ main --debug
+ true
+ main_setup --debug
+ set_up_remote
+ REMOTE=xxx.xxx.xxx.xxx
+ '[' -z xxx.xxx.xxx.xxx ]
+ export REMOTE
+ exec
+ set_up_process_commandline_arguments --debug
+ '[' -n --debug ]
+ set -xv
+ DISABLE_STDERR=false
+ shift
+ '[' -n  ]
+ false
+ init_sudo
+ inpath sudo
+ command -v sudo
+ ROOT_OR_SUDO=
+ export ROOT_OR_SUDO
+ set_up_get_epoch
+ date '+%s'
+ grep '^[0-9].*$'
+ set_up_current_shell
+ + ps -o 'args=' -p 7414
ps: unrecognized option: o
BusyBox v1.37.0 (2026-08-22 10:22:40 UTC) multi-call binary.

Usage: ps

Show list of processes

	w	Wide output
cut '-d ' -f1
+ CURRENT_SHELL=
+ determine_sync_async
+ '['  '=' false ]
+ MK_RUN_SYNC_PARTS=true
+ '['  '=' false ]
+ MK_RUN_ASYNC_PARTS=true
+ set_up_single_directory
+ :
+ set_default_paths
+ : /usr/lib/check_mk_agent
+ : /etc/check_mk
+ : /var/lib/check_mk_agent
+ : /var/log/check_mk_agent
+ : /usr/bin
+ provide_agent_paths
+ '[' -n  ]
+ export MK_LIBDIR
+ export MK_CONFDIR
+ export MK_VARDIR
+ export MK_LOGDIR
+ export MK_BIN
+ PLUGINSDIR=/usr/lib/check_mk_agent/plugins
+ LOCALDIR=/usr/lib/check_mk_agent/local
+ SPOOLDIR=/var/lib/check_mk_agent/spool
+ JOBDIR=/var/lib/check_mk_agent/job
+ CACHEDIR=/var/lib/check_mk_agent/cache
+ announce_remote
+ '[' -d /var/lib/check_mk_agent/rtc_remotes ]
+ mkdir /var/lib/check_mk_agent/rtc_remotes
mkdir: can't create directory '/var/lib/check_mk_agent/rtc_remotes': No such file or directory
+ '[' -n xxx.xxx.xxx.xxx ]
+ '[' xxx.xxx.xxx.xxx '!=' push-connection ]
+ touch /var/lib/check_mk_agent/rtc_remotes/xxx.xxx.xxx.xxx
touch: /var/lib/check_mk_agent/rtc_remotes/xxx.xxx.xxx.xxx: No such file or directory
+ set_up_path /usr/sbin:/usr/bin:/sbin:/bin
+ _PATH=/usr/sbin:/usr/bin:/sbin:/bin
+ '[' /usr/sbin:/usr/bin:/sbin:/bin '!=' /usr/sbin:/usr/bin:/sbin:/bin ]
+ _PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin
+ '[' -n /usr/bin ]
+ '[' :/sbin:/bin:/usr/local/bin '!=' /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin ]
+ '[' -d /var/qmail/bin ]
+ echo /usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin
+ unset _PATH
+ PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin
+ set_up_profiling
+ PROFILING_CONFIG=/etc/check_mk/profiling.cfg
+ '[' -e /etc/check_mk/profiling.cfg ]
+ date '+%Y%m%d_%H%M%S'
+ PROFILING_LOGFILE_DIR=/var/log/check_mk_agent/profiling/20261016_084051
+ false
+ eval '_log_section_time() { "$@"; }'
+ export MK_DEFINE_LOG_SECTION_TIME
+ unset_locale
+ unset -v LANG LC_ALL
+ inpath locale
+ command -v locale
+ LC_ALL=C
+ export LC_ALL
+ detect_python
+ read_python_version python3 3 4
+ inpath python3
+ command -v python3
+ return 1
+ read_python_version python 3 4
+ inpath python
+ command -v python
+ return 1
+ PYTHON3=
+ read_python_version python2 2 6
+ inpath python2
+ command -v python2
+ return 1
+ read_python_version python 2 6
+ inpath python
+ command -v python
+ return 1
+ PYTHON2=
+ '[' -f /etc/check_mk/python_path.cfg ]
+ export PYTHON2 PYTHON3
+ '[' -z  ]
+ '[' -z  ]
+ NO_PYTHON=true
+ detect_container_environment
+ '[' -f /.dockerenv ]
+ grep 'container=lxc' /proc/1/environ
+ grep 'lxcfs /proc/cpuinfo fuse.lxcfs' /proc/mounts
+ unset IS_DOCKERIZED
+ unset IS_LXC_CONTAINER
+ '[' -n  ]
+ '[' -n  ]
+ set_up_encryption
+ '[' -f /etc/check_mk/encryption.cfg ]
+ define_optionally_encrypt no
+ unset optionally_encrypt
+ '[' no '!=' no ]
+ set_up_disabled_sections
+ '[' -f /etc/check_mk/exclude_sections.cfg ]
+ export_utility_functions
+ export -f run_mrpe
/usr/bin/check_mk_agent.busybox: export: line 572: illegal option -f

Also, the Busybox agent is 45% larger than the OpenWrt agent, which is not ideal on resource constrained OpenWrt devices.

root@hostname:~# ls -lah -n 5 /usr/bin/check_mk_agent*
ls: 5: No such file or directory
-rwxr-xr-x    1 0        0          53.6K Oct 13 16:49 /usr/bin/check_mk_agent         (OpenWrt agent)
-rwxr-xr-x    1 0        0          77.5K Oct 16 07:27 /usr/bin/check_mk_agent.busybox (Busybox agent)

The Busybox agent does implement a workaround for the missing waitmax command on OpenWrt devices; waitmax_fallback() { ... }

So, what is the best approach; request that the OpenWrt agent is updated, or the Busybox agent is updated?

In older CheckMk versions, the OpenWrt agent was “the Busybox” agent if you would say so.
But i think i found a solution for your original problem.
The current OpenWrt agent also is checking if the command “timeout” is available and uses this instead of waitmax. This command can be installed inside OpenWrt if the internet source is right. → opkg install coreutils-timeout
With timeout as command the OpenWrt agent should output the df section without further modifications.

@andreas-doehler Thank you for the suggestion.

I can confirm that installing the coreutils-timeout package resolves the issue.

I use OpenWrt version 25.12.5 so used `apk add coreutils-timeout` to install, OpenWrt switched package managers in version 25.

Thank you.