Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

This article helps debug long-running Windows agents. 

...

  1. Open PowerShell and run the agent locally to make sure how long it took

    Code Block
    languagebash
    themeRDark
    Measure-Command { C:\ProgramData\checkmk\agent\bin\cmk-agent-ctl.exe -vv dump > agent_output.txt } > agent_output_time.txt



  2. Go through the check_mk.log* files and use the following grep commands:

    Tip
    titleDisclaimer

    For easier troubleshooting, I moved the files to a Linux server.



    This command will give you a list of all the sections and how long each of them took. We'll also sort by the section name.

    Code Block
    themeRDark
    grep -roP "Section '\w+' took \[\d+\]" |sort -t '[' -k1,1n |uniq -c 



    This command will give you a list of all the sections and how long each of them took. We'll also sort by the time to list the long-running ones first.

    Code Block
    themeRDark
    grep -roP "Section '\w+' took \[\d+\]" |sort -t '[' -k2,2n |uniq -c


...