### Initiate Manual Checkmk Windows Agent Installation Source: https://docs.checkmk.com/2.3.0/en/agent_windows Illustrates the command-line method for starting the manual installation of the Checkmk Windows agent by directly executing the MSI package. This action typically launches the interactive Setup wizard. ```cmd C:\Users\hhirsch\Downloads\> check_mk_agent.msi ``` -------------------------------- ### Start an Existing Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/install_azure This command initiates the operation of a previously created Checkmk site named 'mysite' using the 'omd' administration tool. Starting the site makes its web interface and monitoring services accessible for use. ```bash ubuntu@cloud:~$ sudo omd start mysite ``` -------------------------------- ### Install Checkmk Linux Agent (Vanilla) via APT Source: https://docs.checkmk.com/2.3.0/en/install_azure Installs the Checkmk Linux agent in its default 'Vanilla' configuration directly from the file system using `apt`. This command finds the latest agent `.deb` package within the `/opt/omd/versions/` directory and installs it, simplifying the initial agent setup. ```bash sudo apt install $(sudo find /opt/omd/versions/ -name 'check-mk-agent_*.deb' | tail -n1) ``` -------------------------------- ### Start a Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/install_aws Activates a previously created Checkmk site, making its services and web interface accessible. This command is essential after site creation or if a site has been stopped. ```bash ubuntu@cloud:~$ sudo omd start mysite ``` -------------------------------- ### Livestatus Proxy State File (Starting State) Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This snippet illustrates the `liveproxyd.state` file when the Livestatus proxy is in a 'starting' state. This indicates that the proxy is actively attempting to establish connections to sites. During this phase, queries to the site will typically be answered with an error, and no channels will be available yet. ```Text ---------------------------------------------- Current state: [remote1] State: starting State dump time: 2021-12-01 16:11:35 (0:00:00) Last reset: 2021-12-01 16:11:29 (0:00:06) Site's last reload: 2021-12-01 16:11:29 (0:00:06) Last failed connect: 2021-12-01 16:11:33 (0:00:01) Last failed error: [Errno 111] Connection refused Cached responses: 0 Channels: Clients: Heartbeat: heartbeats received: 0 next in -1.0s Inventory: State: not running Last update: 2021-12-01 16:00:45 (0:10:50) ``` -------------------------------- ### Install New Checkmk Version Package via APT Source: https://docs.checkmk.com/2.3.0/en/install_azure Installs a new Checkmk version package (e.g., 2.2.0p2) using `apt`. This is the first step in updating a Checkmk installation, preparing the new version for site updates while allowing multiple Checkmk versions to coexist on the same server. ```bash sudo apt install ./check-mk-cloud-2.2.0p2_0.jammy_amd64.deb ``` -------------------------------- ### Start a Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This command initiates all services and components associated with the current Checkmk site (e.g., 'remote1'). It ensures that the monitoring system, including its web interface and data collection agents, is fully operational after configuration changes or a system restart. ```Bash OMD[remote1]:~$ omd start Temporary filesystem already mounted Starting mkeventd...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Starting xinetd...OK Initializing Crontab...OK ``` -------------------------------- ### Verify Docker Installation Information Source: https://docs.checkmk.com/2.3.0/en/monitoring_docker This command provides detailed information about the Docker daemon and its environment. It is used to verify the Docker installation and its configuration on the host, which is crucial for Checkmk to properly monitor Docker nodes. The output includes details like server version, storage driver, and runtime, helping to identify potential issues with the Docker setup itself. ```bash root@linux# docker info 2>&1 ``` -------------------------------- ### Starting a Checkmk Site with Livestatus Proxy Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This snippet illustrates the console output when initiating a Checkmk site. It confirms that the 'liveproxyd' (Livestatus proxy daemon) starts successfully alongside other essential Checkmk services, indicating its active status. ```shell OMD[central]:~$ omd start Temporary filesystem already mounted Starting mkeventd...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Starting stunnel...OK Starting xinetd...OK Initializing Crontab...OK ``` -------------------------------- ### Livestatus Proxy Daemon Log File Example Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This snippet shows typical log entries from the Livestatus proxy daemon (`liveproxyd.log`). It illustrates the daemon's startup, configuration reloads, and restart processes, which are essential for troubleshooting operational problems and understanding the proxy's lifecycle events. ```Log 2021-12-01 15:58:30,624 [20] ---------------------------------------------------------- 2021-12-01 15:58:30,627 [20] [cmk.liveproxyd] Livestatus Proxy-Daemon (2.0.0p15) starting... 2021-12-01 15:58:30,638 [20] [cmk.liveproxyd] Configured 1 sites 2021-12-01 15:58:36,690 [20] [cmk.liveproxyd.(3236831).Manager] Reload initiated. Checking if configuration changed. 2021-12-01 15:58:36,692 [20] [cmk.liveproxyd.(3236831).Manager] No configuration changes found, continuing. 2021-12-01 16:00:16,989 [20] [cmk.liveproxyd.(3236831).Manager] Reload initiated. Checking if configuration changed. 2021-12-01 16:00:16,993 [20] [cmk.liveproxyd.(3236831).Manager] Found configuration changes, triggering restart. 2021-12-01 16:00:17,000 [20] [cmk.liveproxyd.(3236831).Manager] Restart initiated. Terminating site processes... 2021-12-01 16:00:17,028 [20] [cmk.liveproxyd.(3236831).Manager] Restart master process ``` -------------------------------- ### Create a New Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/install_azure This command uses the 'omd' administration tool to create a new Checkmk site named 'mysite'. The accompanying output details the site creation process, including temporary filesystem setup, core configuration generation, and provides initial access credentials and the default web UI URL. ```bash ubuntu@cloud:~$ sudo omd create mysite Adding /opt/omd/sites/mysite/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/mysite/tmp...OK Updating core configuration... Generating configuration for core (type cmc)... Starting full compilation for all hosts Creating global helper config...OK Creating cmc protobuf configuration...OK Executing post-create script "01_create-sample-config.py"...OK Restarting Apache...OK Created new site mysite with version 2.2.0p1.cce. The site can be started with omd start mysite. The default web UI is available at http://cloud/mysite/ The admin user for the web applications is cmkadmin with password: UbWeec9QuazIf For command line administration of the site, log in with 'omd su mysite'. After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. ``` -------------------------------- ### Install Checkmk Docker Agent Plugin Source: https://docs.checkmk.com/2.3.0/en/monitoring_docker This command installs the `mk_docker.py` agent plugin into the Checkmk agent's plugin directory, typically `/usr/lib/check_mk_agent/plugins`. It sets the appropriate file permissions (0755) to make the script executable, which is essential for the agent to run it. ```bash root@linux# install -m 0755 mk_docker.py /usr/lib/check_mk_agent/plugins ``` -------------------------------- ### Correct Python Docker Library Installation Source: https://docs.checkmk.com/2.3.0/en/monitoring_docker These commands ensure the correct `docker` Python library is installed by first uninstalling potentially incompatible versions like `docker-py` or any existing `docker` package that might be conflicting. After removal, the correct `docker` package is reinstalled, resolving namespace issues and ensuring proper functionality for the Checkmk agent. ```bash root@linux# pip3 uninstall docker-py docker root@linux# pip3 install docker ``` -------------------------------- ### Checkmk OMD Start Command Output Source: https://docs.checkmk.com/2.3.0/en/ec Demonstrates the output of the `omd start` command, showing the services initiated by Checkmk, including `mkeventd` and its enabled external interfaces (syslog-udp, snmptrap). This output helps verify that the Event Console's network reception is active. ```shell OMD[mysite]:~$ omd start Creating temporary filesystem /omd/sites/mysite/tmp...OK Starting mkeventd (builtin: syslog-udp,snmptrap)...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Initializing Crontab...OK ``` -------------------------------- ### Update Checkmk Site to New Version Source: https://docs.checkmk.com/2.3.0/en/install_azure Updates a specific Checkmk site (e.g., 'mysite') to a newly installed Checkmk version. This process involves stopping the site, performing the update, and then restarting the site to apply changes, ensuring the site runs on the latest installed Checkmk binaries. ```bash sudo omd stop mysite sudo omd update mysite sudo omd start mysite ``` -------------------------------- ### List Checkmk Sites and Versions Source: https://docs.checkmk.com/2.3.0/en/install_azure Displays a list of all Checkmk sites configured on the server, along with their respective versions and any comments. This command is useful for verifying that all sites have been updated after a Checkmk version upgrade, especially in environments with multiple sites. ```bash omd sites ``` -------------------------------- ### Configure APT Sources for Debian 12 Bookworm Source: https://docs.checkmk.com/2.3.0/en/install_packages_debian Example `/etc/apt/sources.list` configuration for Debian 12 (Bookworm). This setup includes the `main` component and the `security` repository, which are necessary for Checkmk's dependencies. The `bookworm-updates` repository is optional but provides earlier access to stability updates. ```apt-sources deb http://deb.debian.org/debian/ bookworm main deb https://security.debian.org/debian-security bookworm-security main # deb http://deb.debian.org/debian bookworm-updates main ``` -------------------------------- ### Configure APT Sources for Ubuntu 22.04 Jammy Jellyfish Source: https://docs.checkmk.com/2.3.0/en/install_packages_debian Example `/etc/apt/sources.list` configuration for Ubuntu 22.04 (Jammy Jellyfish). This setup includes the `main` and `universe` components, along with their `security` repositories, which are essential for Checkmk's dependencies. The `jammy-updates` repositories are optional for receiving stability updates earlier. ```apt-sources deb http://archive.ubuntu.com/ubuntu/ jammy main deb http://archive.ubuntu.com/ubuntu/ jammy universe deb http://archive.ubuntu.com/ubuntu jammy-security main deb http://archive.ubuntu.com/ubuntu jammy-security universe # deb http://archive.ubuntu.com/ubuntu/ jammy-updates main # deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe ``` -------------------------------- ### Update Checkmk Site to New Version Source: https://docs.checkmk.com/2.3.0/en/install_aws This sequence of commands updates a specific Checkmk site to a newly installed Checkmk version. It involves stopping the site, performing the update operation, and then restarting the site, ensuring the site's configuration and components are migrated to the new version. ```bash sudo omd stop mysite sudo omd update mysite sudo omd start mysite ``` -------------------------------- ### Verify and Install Checkmk RPM Package Source: https://docs.checkmk.com/2.3.0/en/install_packages_redhat First, verifies the digital signature of the Checkmk RPM package using `rpm -K` to ensure its integrity and authenticity. Then, installs the package using `yum install`, leveraging the previously imported GPG key for trusted installation. ```bash rpm -K check-mk-raw-2.2.0p1-el8-38.x86_64.rpm yum install check-mk-raw-2.2.0p1-el8-38.x86_64.rpm ``` -------------------------------- ### Download Checkmk GPG Public Key Source: https://docs.checkmk.com/2.3.0/en/install_packages_redhat Downloads the Checkmk GPG public key from the official website using `wget`. This key is a prerequisite for verifying the authenticity and integrity of Checkmk installation packages, ensuring they are untampered and from a trusted source. ```bash wget https://download.checkmk.com/checkmk/Check_MK-pubkey.gpg ``` -------------------------------- ### Checkmk Site Startup Output with SNMP Trap Receiver Source: https://docs.checkmk.com/2.3.0/en/ec This output from the `omd start` command demonstrates the successful startup of a Checkmk site, explicitly showing `mkeventd` starting with the built-in `snmptrap` receiver enabled, confirming SNMP trap reception is active. ```Shell OMD[mysite]:~$ omd start Creating temporary filesystem /omd/sites/mysite/tmp...OK Starting mkeventd (builtin: snmptrap)...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Initializing Crontab...OK ``` -------------------------------- ### Livestatus Query Translation Example Source: https://docs.checkmk.com/2.3.0/en/user_interface Illustrates how a complex search query from the Checkmk Monitor menu is translated into a Livestatus query. This example demonstrates the use of GET, Columns, Filter, Or, And, and Limit clauses in Livestatus. ```Livestatus OMD[mysite]:~$ lq GET services Cache: reload Columns: service_description host_name hostgroups servicegroups Filter: host_name ~~ switch-intern Filter: host_name ~~ localhost Or: 2 Filter: service_description ~~ cpu Filter: service_description ~~ mem Or: 2 And: 2 Limit: 80 CPU utilization;localhost;; Memory;localhost;; CPU load;localhost;; CPU utilization;myhost;; Memory;myhost;; CPU load;myhost;; ``` -------------------------------- ### List Checkmk Sites and Versions Source: https://docs.checkmk.com/2.3.0/en/release_upgrade Displays a list of all configured Checkmk sites, their versions, and any associated comments. This command is useful for getting an overview of the Checkmk installations on the system, especially during preparation for upgrades or migrations. ```bash omd sites ``` -------------------------------- ### Download Checkmk Windows Agent via REST API with curl Source: https://docs.checkmk.com/2.3.0/en/agent_windows Demonstrates how to download the Checkmk Windows agent MSI package from the Checkmk server using the `curl` command. This example fetches the package directly to the target machine, requiring `curl` to be installed. It uses specific headers for authentication and specifies the OS type (`windows_msi`). ```cmd C:\Users\hhirsch\Downloads\> curl -OJG "http://mycmkserver/mysite/check_mk/api/1.0/domain-types/agent/actions/download/invoke" ^ --header "Accept: application/octet-stream" ^ --header "Authorization: Bearer automation myautomationsecret" ^ --data-urlencode "os_type=windows_msi" ``` -------------------------------- ### Check_MK Notification Spooler Central Site Log Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring Example log output from the `mknotifyd.log` file on the central Check_MK site, showing the spooler starting, daemonizing, and successfully establishing an outgoing TCP connection to a remote site. ```Log 2021-11-17 07:11:40,023 [20] [cmk.mknotifyd] ----------------------------------------------------------------- 2021-11-17 07:11:40,023 [20] [cmk.mknotifyd] Check_MK Notification Spooler version 2.0.0p15 starting 2021-11-17 07:11:40,024 [20] [cmk.mknotifyd] Log verbosity: 0 2021-11-17 07:11:40,025 [20] [cmk.mknotifyd] Daemonized with PID 31081. 2021-11-17 07:11:40,029 [20] [cmk.mknotifyd] Connection to 10.1.8.44 port 6555 in progress 2021-11-17 07:11:40,029 [20] [cmk.mknotifyd] Successfully connected to 10.1.8.44:6555 ``` -------------------------------- ### Checkmk MySQL Agent Configuration File Content Source: https://docs.checkmk.com/2.3.0/en/monitoring_mysql Example content for the `mysql.cfg` configuration file used by the Checkmk agent. It specifies the MySQL user ('checkmk') and password ('MyPassword') for the agent to connect to the MySQL instance and retrieve monitoring data. ```INI [client] user=checkmk password=MyPassword ``` -------------------------------- ### Retrieve All Folders Recursively in Checkmk Source: https://docs.checkmk.com/2.3.0/en/rest_api This `curl` command retrieves all folders in the Checkmk Setup recursively, starting from the Main folder, without listing the hosts they contain. It performs a GET request to the `folder_config` collection endpoint with specific data-urlencode parameters. ```bash user@host:~$ curl -G \ --request GET \ --header "Authorization: Bearer $USERNAME $PASSWORD" \ --header "Accept: application/json" \ --data-urlencode 'parent=~' \ --data-urlencode 'recursive=true' \ --data-urlencode 'show_hosts=false' \ "$API_URL/domain-types/folder_config/collections/all" ``` -------------------------------- ### Deploying and Triggering Checkmk Agent xinetd Configuration Source: https://docs.checkmk.com/2.3.0/en/agent_linux_legacy These shell commands execute the Checkmk agent's setup script to deploy the xinetd configuration and then trigger xinetd to re-read its settings. This automates the initial setup process for the agent when using TGZ, DEB, or RPM packages. ```shell root@linux# /var/lib/cmk-agent/scripts/super-server/1_xinetd/setup deploy root@linux# /var/lib/cmk-agent/scripts/super-server/1_xinetd/setup trigger ``` -------------------------------- ### Create a New Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/install_aws Initializes a new Checkmk site with a unique name using the `omd` administration tool. This process sets up the site's directory structure, generates core configurations, and provides initial access credentials for the web UI. ```bash ubuntu@cloud:~$ sudo omd create mysite Adding /opt/omd/sites/mysite/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/mysite/tmp...OK Updating core configuration... Generating configuration for core (type cmc)... Starting full compilation for all hosts Creating global helper config...OK Creating cmc protobuf configuration...OK Executing post-create script "01_create-sample-config.py"...OK Restarting Apache...OK Created new site mysite with version 2.2.0p1.cce. The site can be started with omd start mysite. The default web UI is available at http://cloud/mysite/ The admin user for the web applications is cmkadmin with password: UbWeec9QuazIf For command line administration of the site, log in with 'omd su mysite'. After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. ``` -------------------------------- ### Manage Checkmk Site State with OMD Commands Source: https://docs.checkmk.com/2.3.0/en/intro_setup Demonstrates how to check the status of a Checkmk site's services and how to start a site using the `omd` command-line utility. It includes examples for initial stopped state, successful startup, and running states for both Checkmk Raw and Commercial editions. ```bash OMD[mysite]:~$ omd status agent-receiver: stopped mkeventd: stopped rrdcached: stopped npcd: stopped nagios: stopped apache: stopped redis: stopped crontab: stopped ----------------------- Overall state: stopped ``` ```bash OMD[mysite]:~$ omd start Temporary filesystem already mounted Starting agent-receiver...OK Starting mkeventd...OK Starting rrdcached...OK Starting npcd...OK Starting nagios...OK Starting apache...OK Starting redis...OK Initializing Crontab...OK ``` ```bash OMD[mysite]:~$ omd status agent-receiver: running mkeventd: running rrdcached: running npcd: running nagios: running apache: running redis: running crontab: running ----------------------- Overall state: running ``` ```bash OMD[mysite]:~$ omd status agent-receiver: running mkeventd: running liveproxyd: running mknotifyd: running rrdcached: running cmc: running apache: running dcd: running redis: running crontab: running ----------------------- Overall state: running ``` -------------------------------- ### Checkmk Event Console Debug Log Example Source: https://docs.checkmk.com/2.3.0/en/ec An example log output from `mkeventd.log` showing the detailed processing of an event message, including parsing, rule matching attempts, and reasons for rule non-application. This log helps in debugging Event Console rule evaluation by providing insights into why specific rules did not take effect. ```log [1481020022.001612] Processing message from ('10.40.21.11', 57123): '<22>Dec 6 11:27:02 myserver123 exim[1468]: Delivery complete, 4 message(s) remain.' [1481020022.001664] Parsed message: application: exim facility: 2 host: myserver123 ipaddress: 10.40.21.11 pid: 1468 priority: 6 text: Delivery complete, 4 message(s) remain. time: 1481020022.0 [1481020022.001679] Trying rule test/myrule01... [1481020022.001688] Text: Delivery complete, 4 message(s) remain. [1481020022.001698] Syslog: 2.6 [1481020022.001705] Host: myserver123 [1481020022.001725] did not match because of wrong application 'exim' (need 'security') [1481020022.001733] Trying rule test/myrule02n... [1481020022.001739] Text: Delivery complete, 4 message(s) remain. [1481020022.001746] Syslog: 2.6 [1481020022.001751] Host: myserver123 [1481020022.001764] did not match because of wrong text ``` -------------------------------- ### Install Checkmk Agent on Debian/Ubuntu Source: https://docs.checkmk.com/2.3.0/en/install_aws This command installs the Checkmk Linux agent package directly from the local file system on Debian/Ubuntu systems. It locates the latest '.deb' package within the OMD versions directory and uses 'apt install' for installation, setting up the agent in its default 'Vanilla' configuration. ```bash sudo apt install $(sudo find /opt/omd/versions/ -name 'check-mk-agent_*.deb' | tail -n1) ``` -------------------------------- ### Start Checkmk Site Services Source: https://docs.checkmk.com/2.3.0/en/graphing Shows the output of the `omd start` command, which initializes and starts various core services for a Checkmk site. This includes critical components like `agent-receiver`, `mkeventd`, `liveproxyd`, `rrdcached`, `cmc`, `apache`, `dcd`, and `redis`, demonstrating the typical startup sequence. ```shell OMD[mysite]:~$ omd start Temporary filesystem already mounted Starting agent-receiver...OK Starting mkeventd...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Initializing Crontab...OK ``` -------------------------------- ### Install Python Docker Library via pip Source: https://docs.checkmk.com/2.3.0/en/monitoring_docker This command installs the necessary `docker` Python library using `pip3`. This library is a prerequisite for the `mk_docker.py` agent plugin, enabling it to interact with the Docker API and collect monitoring data. ```bash root@linux# pip3 install docker ``` -------------------------------- ### Starting a Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/update Once the update process is complete and the new version has been verified, this command starts the Checkmk site. This makes the monitoring system operational again, allowing it to collect and display data. ```shell OMD[mysite]:~$ omd start ``` -------------------------------- ### Create a New Checkmk Remote Site Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This command initializes a new Checkmk site named 'remote1' on a remote server. It sets up the necessary directories, configurations, and services, making the site ready for use. The output provides details like the site version, web UI URL, and initial admin credentials. ```Bash root@linux# omd create remote1 Adding /opt/omd/sites/remote1/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/remote1/tmp...OK Updating core configuration... Generating configuration for core (type cmc)... Starting full compilation for all hosts Creating global helper config...OK Creating cmc protobuf configuration...OK Executing post-create script "01_create-sample-config.py"...OK Restarting Apache...OK Created new site remote1 with version 2.2.0p1.cee. The site can be started with omd start remote1. The default web UI is available at http://myserver/remote1/ The admin user for the web applications is cmkadmin with password: lEnM8dUV For command line administration of the site, log in with 'omd su remote1' After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. ``` -------------------------------- ### Example Nagios Monitoring Status File Format Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This code block provides an example of the monitoring status file generated by `livedump`. It shows key-value pairs representing host and service check results, including details like `host_name`, `return_code`, and `output`. ```Nagios Status host_name=myhost1900 check_type=1 check_options=0 reschedule_check latency=0.13 start_time=1615521257.2 finish_time=16175521257.2 return_code=0 output=OK - 10.1.5.44: rta 0.066ms, lost 0%|rta=0.066ms;200.000;500.000;0; pl=0%;80;100;; rtmax=0.242ms;;;; rtmin=0.017ms;;;; ``` -------------------------------- ### Create Checkmk Monitoring Site Source: https://docs.checkmk.com/2.3.0/en/install_azure This command is used to create a new monitoring site within Checkmk. It requires specifying the desired site name, which should match the source system's site name for backup restoration purposes. ```CLI omd create ``` -------------------------------- ### Creating a New OMD Monitoring Site Source: https://docs.checkmk.com/2.3.0/en/omd_basics Demonstrates how to create a new OMD monitoring site using the `omd create` command. The output shows the setup process, including temporary filesystem creation, core configuration, and details for accessing the web UI and command-line administration. ```Shell root@linux# omd create mysite Adding /opt/omd/sites/mysite/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/mysite/tmp...OK Updating core configuration... Generating configuration for core (type nagios)... Precompiling host checks...OK Executing post-create script "01_create-sample-config.py"...OK Restarting Apache...OK Created new site mysite with version 2.1.0p17.cre. The site can be started with omd start mysite. The default web UI is available at http://linux/mysite/ The admin user for the web applications is cmkadmin with password: YzxfoFZh For command line administration of the site, log in with 'omd su mysite'. After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. ``` -------------------------------- ### Docker Run Command Options for Checkmk Source: https://docs.checkmk.com/2.3.0/en/introduction_docker Detailed explanation of the various options used with the `docker container run` command specifically for setting up Checkmk Raw, covering port mappings, volume management, and container behavior. ```APIDOC Option: -p 8080:5000 Description: Publishes port 8080 of the Docker host to port 5000 of the container, making the web server accessible from outside. Can be changed to -p 80:5000 for standard HTTP port. Option: -p 8000:8000 Description: Publishes port 8000 for the Agent Receiver, required for agent registration since Checkmk 2.1.0. Option: --tmpfs /opt/omd/sites/cmk/tmp:uid=1000,gid=1000 Description: Mounts a temporary file system in RAM for optimal performance. The path must be edited if the site ID changes. Option: -v monitoring:/omd/sites Description: Binds container site data to a persistent location on the Docker host, preventing data loss if the container is deleted. 'monitoring' is the volume name. Option: --name monitoring Description: Assigns a unique name to the container ('monitoring'). This name must be unique on the Docker host. Option: -v /etc/localtime:/etc/localtime:ro Description: Mounts the host's localtime file into the container as read-only, ensuring the same timezone is used. Option: --restart always Description: Configures the container to always restart automatically if it stops, unless manually stopped. It will restart on Docker daemon restart or manual container restart. Option: checkmk/check-mk-raw:2.3.0-latest Description: Specifies the Checkmk image label in the : format. The exact labels can be found using 'docker images'. ``` -------------------------------- ### Install New Checkmk Version Package on Debian/Ubuntu Source: https://docs.checkmk.com/2.3.0/en/install_aws This command installs a new Checkmk version package (e.g., '2.2.0p2') on a Debian/Ubuntu system. It's the first step in updating Checkmk, allowing multiple Checkmk versions to coexist on the same server before specific sites are updated to the new version. ```bash sudo apt install ./check-mk-cloud-2.2.0p2_0.jammy_amd64.deb ``` -------------------------------- ### List All Checkmk Sites and Versions Source: https://docs.checkmk.com/2.3.0/en/install_aws This command displays a list of all Checkmk sites configured on the server, along with their respective versions and any comments. It's useful for verifying that all sites are updated after a Checkmk version upgrade, especially in environments with multiple production or testing sites. ```bash omd sites ``` -------------------------------- ### Start Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/simulation_mode This shell command (`omd start`) initiates the Checkmk site. When simulation mode is active, the site will start and operate using cached data, avoiding live queries to monitoring agents. This allows for testing and evaluation without impacting production systems or requiring network access to monitored hosts. ```Shell OMD[mysite]:~$ omd start Creating temporary filesystem /omd/sites/mysite/tmp...OK Starting agent-receiver...OK Starting mkeventd...OK Starting liveproxyd...OK Starting mknotifyd...OK Starting rrdcached...OK Starting cmc...OK Starting apache...OK Starting dcd...OK Starting redis...OK Initializing Crontab...OK ``` -------------------------------- ### Check_MK Notification Log Central Site Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring Example log entry from `notify.log` on the central Check_MK site, indicating the successful reception of a spool file from a remote host for local notification delivery, typically after a test notification. ```Log 2021-11-17 07:59:36,231 ---------------------------------------------------------------------- 2021-11-17 07:59:36,232 [20] [cmk.base.notify] Got spool file 307ad477 (myremotehost123;Check_MK) from remote host for local delivery. ``` -------------------------------- ### Create a new Checkmk site Source: https://docs.checkmk.com/2.3.0/en/intro_setup This command, executed as `root`, creates a new Checkmk site with the specified name. It sets up the site directory, creates a dedicated Linux user and group, configures default settings, and generates a web interface admin user (`cmkadmin`) with a random password. The output provides essential information for starting the site, accessing the web UI, and managing the site from the command line. ```bash root@linux# omd create mysite Adding /opt/omd/sites/mysite/tmp to /etc/fstab. Creating temporary filesystem /omd/sites/mysite/tmp...OK Updating core configuration... Generating configuration for core (type nagios)... Precompiling host checks...OK Executing post-create script "01_create-sample-config.py"...OK Executing post-create script "02_cmk-compute-api-spec"...OK Restarting Apache...OK Created new site mysite with version 2.3.0p1.cre. The site can be started with omd start mysite. The default web UI is available at http://linux/mysite/ The admin user for the web applications is cmkadmin with password: YzxfoFZh For command line administration of the site, log in with 'omd su mysite'. After logging in, you can change the password for cmkadmin with 'cmk-passwd cmkadmin'. ``` -------------------------------- ### Check_MK Notification Log Remote Site Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring Example log entry from `notify.log` on a remote Check_MK site, showing the processing of a raw notification context received from the central site and the subsequent creation of a spool file for local handling. ```Log 2021-11-17 07:59:28,161 [20] [cmk.base.notify] ---------------------------------------------------------------------- 2021-11-17 07:59:28,161 [20] [cmk.base.notify] Got raw notification (myremotehost123;Check_MK) context with 71 variables 2021-11-17 07:59:28,162 [20] [cmk.base.notify] Creating spoolfile: /omd/sites/remote1/var/check_mk/notify/spool/307ad477-b534-4cc0-99c9-db1c517b31f ``` -------------------------------- ### Example Nagios Host and Service Configuration File Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This code block illustrates the structure of a Nagios configuration file generated by `livedump -TC`. It defines a host and a service, showcasing typical Checkmk-related attributes like `passive_checks_enabled` and `register`. ```Nagios Config define host { name livedump-host use check_mk_default register 0 active_checks_enabled 0 passive_checks_enabled 1 } define service { name livedump-service register 0 active_checks_enabled 0 passive_checks_enabled 1 check_period 0x0 } ``` -------------------------------- ### Retrieve Hosts in a Specific Checkmk Folder Source: https://docs.checkmk.com/2.3.0/en/rest_api This `curl` command fetches all hosts located within a specific folder (e.g., 'Main > Linux') in the Checkmk setup. It performs a GET request to the `folder_config` objects endpoint, targeting a specific folder path. ```bash user@host:~$ curl \ --request GET \ --header "Authorization: Bearer $USERNAME $PASSWORD" \ --header "Accept: application/json" \ "$API_URL/objects/folder_config/~linux/collections/hosts" ``` -------------------------------- ### Checkmk Site Creation and Initialization Commands Source: https://docs.checkmk.com/2.3.0/en/omd_basics Reference for `omd` commands used to create and initialize Checkmk monitoring sites, including options for custom setup workflows and delayed initialization. ```APIDOC omd create [--no-init] - Description: Creates a new Checkmk site. By default, it populates the site directory with default files and integrates with the system Apache. - Parameters: - --no-init (optional): Creates an empty site directory without default files or Apache integration. This is useful for scenarios where an external volume will be mounted at this location. - (required): The unique name for the new Checkmk site. - Permissions: Requires root privileges. - Returns: Confirmation of site creation. - Usage: root@linux# omd create --no-init mysite omd init - Description: Initializes a Checkmk site that was previously created with the `--no-init` option. This command adds the default files and configures Apache integration, completing the site setup. - Parameters: - (required): The name of the site to initialize. - Permissions: Requires root privileges. - Returns: Confirmation of site initialization. - Usage: root@linux# omd init mysite ``` -------------------------------- ### Start All Services for a Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/omd_basics Demonstrates how to start all associated services for a Checkmk site when logged in as the site user. This command initializes various components like agent-receiver, mkeventd, rrdcached, nagios, apache, and redis, bringing the monitoring site online. ```bash OMD[mysite]:~$ omd start ``` -------------------------------- ### Verifying Checkmk Installation with OMD Source: https://docs.checkmk.com/2.3.0/en/install_packages_sles This command uses the `omd` utility, which is available after a successful Checkmk installation, to display the installed version of the Open Monitoring Distribution (OMD). It serves as a final verification step to confirm Checkmk is correctly installed and accessible. ```Shell root@linux# omd version ``` -------------------------------- ### Initial Setup for Checkmk Host Creation Script Source: https://docs.checkmk.com/2.3.0/en/rest_api This snippet shows the initial content for `create_host.sh`, a bash script intended for creating a host via the Checkmk REST API. It includes a shebang and a crucial note advising the use of `httpie` over `curl` for more robust and consistent scripting, especially for complex requests. ```bash #!/bin/bash # NOTE: We recommend all shell users to use the "httpie" examples instead. # `curl` should not be used for writing large scripts. ``` -------------------------------- ### Initialize an Existing Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/omd_basics Shows how to initialize a Checkmk site that was previously created with the `--no-init` option. This command adds the necessary default files and configures Apache integration, completing the site setup. ```bash root@linux# omd init mysite ``` -------------------------------- ### Filter Checkmk Livedump Output by Host Group Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This command demonstrates how to apply a Livestatus filter to the `livedump` output. By using the `-H` option with a filter string, you can restrict the generated status or configuration data to specific hosts, for example, only those belonging to the `mygroup` host group. ```Shell livedump -H "Filter: host_groups >= mygroup" > state ``` -------------------------------- ### Register Checkmk Agent with Checkmk Server Source: https://docs.checkmk.com/2.3.0/en/install_aws After installing the Checkmk agent, this command registers it with the Checkmk server, securing the communication. It specifies the agent's hostname, the server's address, the target site, and the administrative user for registration, preventing unauthorized access to agent output. ```bash sudo cmk-agent-ctl register --hostname localhost --server localhost --site mysite --user cmkadmin ``` -------------------------------- ### Create New Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/release_upgrade Creates a new Checkmk site with the specified name. This command initializes the site structure and prepares it for use, often as a prerequisite for restoring a backup onto a new system or fresh installation. ```bash omd create mysite ``` -------------------------------- ### Generate Nagios Configuration from Remote Checkmk Site Source: https://docs.checkmk.com/2.3.0/en/distributed_monitoring This command uses `livedump -TC` on a remote Checkmk site to generate a copy of its host and service configurations in Nagios format. The output is redirected to a `.cfg` file, which includes template definitions essential for Nagios to start correctly. ```Shell livedump -TC > config-remote1.cfg ``` -------------------------------- ### Start Checkmk Site from Site Context Source: https://docs.checkmk.com/2.3.0/en/release_upgrade Starts the current Checkmk site when executed from within the site's shell context (e.g., as the site user). This command brings the Checkmk monitoring system back online after maintenance or restoration, without needing to specify the site name. ```bash omd start ``` -------------------------------- ### Checkmk GUI Keyboard Shortcuts for Navigation Source: https://docs.checkmk.com/2.3.0/en/intro_gui This section lists keyboard shortcuts available for quick navigation and interaction within the Checkmk graphical user interface, specifically for opening main menus and managing search results. ```APIDOC Checkmk GUI Keyboard Shortcuts: ALT+m - Opens the Monitor menu. ALT+c - Opens the Customize menu. ALT+s - Opens the Setup menu. ESC - Closes the open menu. TAB - Navigates to the next hit in search results. SHIFT+TAB - Navigates to the previous hit in search results. ENTER - Calls up the selected search hit. ESC (with active search term) - Closes search results when a search term is active. ``` -------------------------------- ### Register Checkmk Agent for Localhost Monitoring Source: https://docs.checkmk.com/2.3.0/en/install_azure Registers the Checkmk agent with the Checkmk server for monitoring the local host. This command sets up secure communication and prevents unauthorized access to agent output, which is crucial after initial installation where the agent listens in unencrypted legacy pull mode. ```bash sudo cmk-agent-ctl register --hostname localhost --server localhost --site mysite --user cmkadmin ``` -------------------------------- ### Setting up Checkmk Docker Container with Optional Parameters Source: https://docs.checkmk.com/2.3.0/en/managing_docker This command demonstrates how to create and configure a Checkmk Docker container, incorporating various optional settings. It includes setting a custom site ID, mapping ports for HTTP/HTTPS, Livestatus, and Event Console, and mounting temporary and persistent volumes. Other optional parameters like `CMK_PASSWORD` for initial password and `MAIL_RELAY_HOST` for email notifications can be added as additional `-e` flags. ```bash root@linux# docker container run -e CMK_SITE_ID="mysite" -dit -p 8080:5000 -p 8000:8000 --tmpfs /opt/omd/sites/mysite/tmp:uid=1000,gid=1000 -v monitoring:/omd/sites --name monitoring -v /etc/localtime:/etc/localtime:ro --restart always checkmk/check-mk-raw:2.1.0-latest ``` -------------------------------- ### Configuring Checkmk Site Addons via OMD Config Source: https://docs.checkmk.com/2.3.0/en/managing_docker After accessing the Checkmk container's command line, this sequence demonstrates how to launch the `omd config` utility. This tool is used to activate and manage various add-ons and settings for the Checkmk site, such as enabling Event Console ports. ```bash root@linux# docker container exec -it -u cmk monitoring bash OMD[mysite]:~$ omd config ```