RAW, need help with check_mk.user.yml, some editing is not working

CMK version:2.3.0p29
OS version: server: debian12, host: windows 11

Error message: check_mk.user.yml modification not working

Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Hey people,

using checkmk raw for a while, 2.3 version, but only with pre-defined check_mk.user.yml.

File location here: “ProgramData/checkmk/agent/”

Now I want to use some of the plugins und change: async, timeout, cache_age, retry_count of these.

Copying the plugins to
ProgramData/checkmk/agent/plugins is working, but custom setup not.

For example this is not working: (use the build-in plugin without copy in this path:
“Program Files(x86)/checkmk/service/plugins”)

- pattern : '$BUILTIN_PLUGINS_PATH$\windows_tasks.ps1'
async : yes
timeout : 300
cache_age : 3600
retry_count : 3

After every change I use Validate YAML - Online YAML Tools to verify the code.

Add custom entrys like this:

- pattern : '$CUSTOM_PLUGINS_PATH$\veeam_backup_status.ps1'
async : yes
timeout : 600
cache_age : 3600
retry_count : 3

is also not working if I disable this:

- pattern : '$CUSTOM_PLUGINS_PATH$\*.*' 
timeout : 90 
run : no

which shows me that something with my custom entry is wrong.

Think for lot of checkmk people its easy, but I can not find my error.

Here is my check_mk.user.yml:

the windows_updates.vbs file is in “ProgramData/checkmk/agent/plugins”

global:
        only_from: 192.168.22.45
        port: 6556
        ipv6: no
        
        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 
        - agent_plugins
        
        
        realtime:
            enabled: yes
            timeout: 60
    
            port: 6559
            # enable/disable encryption of regular agent output (default: no) 
            encrypted: no
            
        # In seconds. Windows may be slow during WMI, increase the value when you have problems
        wmi_timeout: 12
        
ps:
    enabled: yes
    use_wmi: yes
    # full_path: yes # This value has effect only when use_wmi is set
    

plugins:
    enabled: yes
    max_wait: 60 



  async_start: yes # start plugins asynchronous, this is default

    # folders are scanned left -> right, order is important
    # all files from folders are gathered and verified, duplicated files will be removed
    # folders: ['$CUSTOM_PLUGINS_PATH$', '$BUILTIN_PLUGINS_PATH$' ]       # ProgramData/checkmk/agent/plugins & Program Files x86/checkmk/service/plugins

    execution:
             #$CUSTOM_PLUGINS_PATH$ -> is ProgramData/checkmk/agent/plugins
             #$BUILTIN_PLUGINS_PATH$ -> is Program Files(x86)/checkmk/service/plugins
  
              
        - pattern     : '$CUSTOM_PLUGINS_PATH$\windows_updates.vbs'
          async       : yes
          timeout     : 3600
          cache_age   : 14400
          retry_count : 3
          
         
    
        - pattern     : '$CUSTOM_PLUGINS_PATH$\*.*'         # in the ProgramData folder. DO NOT REMOVE THIS ENTRY
          timeout     : 90                  # after 30 seconds process will be killed. 60 sec is default in check_mk.yml
          run         : no                 # ALL FOUND files will be started. This is default value

        - pattern     : '$BUILTIN_PLUGINS_PATH$\*.*'         # in the ProgramFiles folder. DO NOT REMOVE THIS ENTRY
          timeout     : 90                  # after 30 seconds process will be killed. 60 sec is default in check_mk.yml
          run         : no                  # No run, i.e disabled.

        - pattern     : '*'                 # This is safety entry. Try not use plugins outside your predefined folder
          run         : no                  # No run, i.e. disabked.
          
          
local:


mrpe:
    enabled: true

    # 60 is default, this is safe value, because mrpe checks are relative fast ergo
    # hitting this timeout is virtually not possible
    # timeout: 60

    # entries and cfg are the same as in the Legacy agent
    config:
      - check = check_os C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy bypass -file C:\ProgramData\checkmk\agent\mrpe\check_os.ps1
        # *Relative* path are supported for checks and includes
        # Path below is equal to '$CUSTOM_AGENT_PATH$\plugins\your_check.com'
        # - check = Console 'plugins\your_check.com' CON CP /STATUS
        # - check = Console 'c:\windows\system32\mode.com' CON CP /STATUS
        # Special case with cache time and add or not cache time info to the output
        #       Description (max_age:add_info) command line  
        # - check = Checker (100:yes) 'c:\windows\system32\mode.com' 
        # - include user_name = $CUSTOM_AGENT_PATH$\mrpe_checks.cfg
        # - include = $CUSTOM_AGENT_PATH$\mrpe_checks.cfg


extensions:
    enabled: yes

modules:
    enabled: yes

system:
    enabled: yes

All the shown code/config snippets have formatting problems.
The short ones missing any indentation.

At the complete check_mk.user.yaml the “async_start: yes” has the wrong indentation. This small error leads to all the other parts of this block to get ignored.

I use the same for some of my systems.
The plugins part looks like this.

plugins:
  enabled: true
  execution:
    - pattern: '$BUILTIN_PLUGINS_PATH$\windows_updates.vbs'
      timeout: 3600
      run: yes
      async: yes
      cache_age: 90000
    - pattern: '$BUILTIN_PLUGINS_PATH$\mk_inventory.vbs'
      async: yes
      run: yes

This is working without any problem. I would also recommend to use a empty file with only your settings and not edit the demo config file.

2 Likes

Hey, thanks for your answer!

check_mk.user.yml is running now! :slight_smile: