Werk #16581: Automatic creation of labels based on OS information from the agent

Component Checks & agents
Title Automatic creation of labels based on OS information from the agent
Date Mar 8, 2024
Level Trivial Change
Class New Feature
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0b2 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Checkmk automatically creates host labels based on OS data sent by the agents on check_mk section. 

  • cmk/os_type: High-level category of the OS, e.g., linux, windows, or aix. Value taken from OSType line.
  • cmk/os_platform: The distribution of the OS, e.g., freebsd, openbsd, debian, ubuntu, or redhat. Value is taken from OSPlatform line.
  • cmk/os_name: The human-readable name of the OS, e.g., Windows, Debian GNU/Linux, or Mac OS X. Value taken from OSName line.
  • cmk/os_version: The numeric version of the OS, e.g., 24.04 for Ubuntu, or 10.0.14393 for Windows. Value taken from OSVersion line.

No label is created if the respective line is not present. cmk/os_platform will fall back to AgentOS, if OSPlatform is unavailable.

The label cmk/os_family has been present in Checkmk for a while now. However, which this Werk we introduced cmk/os_type as a drop-in replacement. cmk/os_family will still be available for some time, but it will be removed from Checkmk eventually. Please start migration e.g., your rules, filters, views or dasboards to cmk/os_type.

The following list shows an example of the information that agents send for the labels creation. The source is noted in square brackets.

  • AIX

    • AgentOS: aix
    • OSType: unix
    • OSName: AIX
    • OSVersion: [oslevel -s]: 7100-05-04-1914
  • FreeBSD

    • AgentOS: freebsd
    • OSType: unix
    • OSName: [/etc/os-release (NAME)]: FreeBSD
    • OSVersion: [/etc/os-release (VERSION_ID)]: 13.2
  • HP-UX

    • AgentOS: hpux
    • OSType: unix
    • OSName: HP-UX
    • OSVersion: [uname -r | cut -d' ' -f1]: B.11.31
  • Linux

    • AgentOS: linux
    • OSType: linux
    • OSPlatform: [/etc/os-release (ID)]: ubuntu
    • OSName: [/etc/os-release (NAME)]: Ubuntu
    • OSVersion: [/etc/os-release (VERSION_ID)]: 22.04
  • MacOS

    • AgentOS: macosx
    • OSType: macos
    • OSName: [sw_vers -productName]: macOS
    • OSVersion: [sw_vers -productVersion]: 13.0
  • NetBSD

    • AgentOS: netbsd
    • OSType: unix
    • OSName: [uname -s]: NetBSD
    • OSVersion: [uname -r]: 9.3
  • OpenBSD

    • AgentOS: openbsd
    • OSType: unix
    • OSName: [uname -s]: OpenBSD
    • OSVersion: [uname -r]: 7.4
  • OpenVMS

    • AgentOS: openvms
    • OSName: OpenVMS
  • OpenWRT

    • AgentOS: openwrt
    • OSType: linux
    • OSName: [/etc/os-release (NAME)]: OpenWRT
    • OSVersion: [/etc/os-release (VERSION_ID)]: snapshot
  • Solaris

    • AgentOS: solaris
    • OSType: unix
    • OSName: [/etc/os-release (NAME)]: Oracle Solaris
    • OSVersion: [/etc/os-release (VERSION_ID)]: 11.4
  • Windows

    • AgentOS: windows
    • OSType: windows
    • OSName: [wmi]: Microsoft Windows 10 Pro
    • OSVersion: [wmi]: 10.0.19045
  • z/OS

    • AgentOS: z/OS
    • OSType: z/os
    • OSName: z/OS

To the list of all Werks