Troubleshooting feature request - cmk-agent-ctl dump command- option to add total time each script/plugin took to run

CMK version: 2.3.0p20
OS version: mixed environment windows & linux

We would love to see a feature added to the cmk-agent-ctl dump command (or maybe an alternative command) which would output how long it takes to run each section.

we have seen issues where occasionally agents are taking 180s + to complete the dump. eventually we can track it down by disabling plugins or checks but it would be a lot easier if there was a version of the dump command which just gave the details of how long each script is taking to finish

Did you know that the checkmk agent has built-in profiling? To enable it, follow these steps:

  1. Create the file /etc/check_mk/profiling.cfg with following content:
LOG_SECTION_TIME=true
  1. If the checkmk agent does not run as root, create the following directory (if the agent runs as root (as usual), the directory is created automatically)
/var/log/check_mk_agent/profiling
  1. Restart the asynchronous checkmk agent, so that it also picks up the new config file
systemctl restart check-mk-agent-async.service
  1. Wait a few minutes and then check out the files and directories below /var/log/check_mk_agent/profiling.

When done, delete the config file and the profiling directory and restart the async agent.


As an alternative to the above you can also start the checkmk agent once in the foreground with profiling enabled:

check_mk_agent --profile # or -p

is that also valid for windows checkmk agents? thats where we see the issue the most

I’m sorry, I cannot tell about the Windows part.

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.