CheckMK version 2.0.0P1 vs CheckMK version 2.0.0p16 (CRE): Agent takes nearly double time to answer

This is the config file of my agent on that particular server

C:\Program Files (x86)\checkmk\service>check_mk_agent.exe showconfig
# Environment Variables:
# MK_LOCALDIR="C:\ProgramData\checkmk\agent\local"
# MK_STATEDIR="C:\ProgramData\checkmk\agent\state"
# MK_PLUGINSDIR="C:\ProgramData\checkmk\agent\plugins"
# MK_TEMPDIR="C:\ProgramData\checkmk\agent\tmp"
# MK_LOGDIR="C:\ProgramData\checkmk\agent\log"
# MK_CONFDIR="C:\ProgramData\checkmk\agent\config"
# MK_SPOOLDIR="C:\ProgramData\checkmk\agent\spool"
# MK_INSTALLDIR="C:\ProgramData\checkmk\agent\install"
# MK_MSI_PATH="C:\ProgramData\checkmk\agent\update"
# MK_MODULESDIR="C:\ProgramData\checkmk\agent\modules"
# Loaded Config Files:
# system: 'C:\Program Files (x86)\checkmk\service\check_mk.yml'
# bakery: 'C:\ProgramData\checkmk\agent\bakery'
# user  : 'C:\ProgramData\checkmk\agent\check_mk.user.yml'

#
global:
  enabled: yes
  async_script_execution: parallel
  only_from: ~
  port: 6556
  ipv6: no
  encrypted: no
  passphrase: secret
  execute: [exe, bat, vbs, cmd, ps1]
  async: yes
  try_kill_plugin_process: safe
  sections:
    - check_mk
    - mrpe
    - skype
    - spool
    - plugins
    - local
    - winperf
    - uptime
    - systemtime
    - df
    - mem
    - services
    - msexch
    - dotnet_clrmemory
    - wmi_webservices
    - wmi_cpuload
    - ps
    - fileinfo
    - logwatch
    - openhardwaremonitor
  disabled_sections: [mrpe, skype, spool, plugins, local, winperf, uptime, systemtime, df, mem, services, msexch, dotnet_clrmemory, wmi_webservices, wmi_cpuload, ps, fileinfo, logwatch,openhardwaremonitor]
  realtime:
    enabled: no
    timeout: 90
    port: 6559
    encrypted: no
    passphrase: this is my password
    run: [mem, df, winperf_processor]
  wmi_timeout: 5
  logging:
    location: ~
    file: ~
    debug: yes
    windbg: yes
    eventlog: yes
ps:
  enabled: yes
  use_wmi: yes
  full_path: no
winperf:
  enabled: yes
  exe: agent
  trace: no
  fork: yes
  prefix: winperf
  timeout: 10
  counters:
    - 234: phydisk
    - 510: if
    - 238: processor
fileinfo:
  enabled: yes
  path: []
logwatch:
  enabled: yes
  sendall: no
  vista_api: no
  max_size: 500000
  max_line_length: -1
  max_entries: -1
  timeout: -1
  logfile:
    - Parameters: ignore
    - State: ignore
    - "*": warn nocontext
plugins:
  enabled: yes
  player: ""
  max_wait: 60
  async_start: yes
  folders: [$CUSTOM_PLUGINS_PATH$, $BUILTIN_PLUGINS_PATH$]
  execution:
    - pattern: $CUSTOM_PLUGINS_PATH$\cmk-update-agent.exe
      run: no
    - pattern: $CUSTOM_PLUGINS_PATH$\*.*
      timeout: 60
      run: yes
    - pattern: $BUILTIN_PLUGINS_PATH$\*.*
      timeout: 60
      run: no
    - pattern: "*"
      run: no
local:
  enabled: yes
  player: ""
  max_wait: 60
  async_start: true
  execution:
    - pattern: "*.*"
      timeout: 60
      run: yes
mrpe:
  enabled: yes
  parallel: no
  timeout: 60
  config: ~
modules:
  enabled: yes
  python: auto
  quick_reinstall: no
  table:
    - name: python-3.8
      exts: [.checkmk.py, .py]
      exec: .venv\Scripts\python.exe {}
system:
  enabled: yes
  firewall:
    mode: configure
    port: auto
  cleanup_uninstall: smart
  wait_network: 30
  service:
    restart_on_crash: yes
    error_mode: log
    start_mode: auto

First things i see is a broken WMI on the monitored server.

Second point is - your disabled section looks like it is not recognized. Do you have somewhere an explicit enabled section defined?
I have only a “sections” point defined like this

global:
  sections: 
    - check_mk 
    - spool 
    - plugins
    - local
    - winperf 
    - uptime 
    - systemtime 
    - df 
    - mem 
    - services 
    - dotnet_clrmemory
    - wmi_webservices
    - wmi_cpuload
    - ps 
    - fileinfo 
    - logwatch 

and this results in the following output of the “showconfig”.

  sections:
    - check_mk
    - spool
    - plugins
    - local
    - winperf
    - uptime
    - systemtime
    - df
    - mem
    - services
    - dotnet_clrmemory
    - wmi_webservices
    - wmi_cpuload
    - ps
    - fileinfo
    - logwatch

exactly the same.

With the last lines you see that it only takes so long as it tries to get many WMI things that your system cannot provide.

Ok, I got it down to 5 seconds execution time.
The issue was that I didn’t know there were 2 config files actively being used!

# system: 'C:\Program Files (x86)\checkmk\service\check_mk.yml'
# user  : 'C:\ProgramData\checkmk\agent\check_mk.user.yml'

And it seems I have to change it in both files otherwise the agent will continue using the same config again and again.

I don’t know why there isn’t put more effort in into making that fact more obvious.
Thanks for the help again, I can now go fix other servers as well.

No, the file inside ‘C:\Program Files (x86)\checkmk\service\check_mk.yml’ is forbidden to modify.
Only use the “check_mk.user.yml”.

1 Like

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.