Files
ProxmoxVE/install/checkmk-install.sh
T
CanbiZ (MickLesk) 7f57d0998c Refactor/core qol adoption (#17655)
* Scripts: close every msg_info block with msg_ok

Past-tense msg_info calls that should have been msg_ok, notices that opened a block before a prompt, and blocks without a closing msg_ok. These already left a stale spinner; with core's block stack they would resume it after every later msg_ok.

* Generate passwords with random_password

openssl rand -base64 | tr -dc | head -c returned fewer characters than asked for, and the unfiltered | cut variants put / and + into passwords that end up in DSNs and sed expressions. Secrets an app decodes as base64 are unchanged. Requires community-scripts/core#61.

* Keep data directories through CLEAN_INSTALL instead of copying them

create_backup copied uploads, storage and similar directories twice per update and needed their size again in free space. CLEAN_INSTALL_KEEP moves them aside instead. Only directories the upstream release does not ship, in scripts that restored right after the fetch. Requires community-scripts/core#61.

* Drop the 300s uv timeout overrides

setup_uv exports UV_HTTP_TIMEOUT=600 now; the scripts' 300 only lowered it. Requires community-scripts/core#61.
2026-10-03 08:19:10 +02:00

43 lines
1.3 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: Michel Roegl-Brunner (michelroegl-brunner)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://checkmk.com/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Install Checkmk"
RELEASE=$(curl_with_retry "https://api.github.com/repos/checkmk/checkmk/tags" "-" | grep "name" | awk '{print substr($2, 3, length($2)-4) }' | tr ' ' '\n' | grep -Ev 'rc|b' | sort -V | tail -n 1)
RELEASE="${RELEASE%%+*}"
curl_download "/opt/checkmk.deb" "https://download.checkmk.com/checkmk/${RELEASE}/check-mk-community-${RELEASE}_0.$(get_os_info codename)_amd64.deb"
$STD apt install -y /opt/checkmk.deb
rm -rf /opt/checkmk.deb
echo "${RELEASE}" >"/opt/checkmk_version.txt"
msg_ok "Installed Checkmk"
msg_info "Creating Service"
SITE_NAME="monitoring"
$STD omd create "$SITE_NAME"
MKPASSWORD=$(random_password 16)
echo -e "$MKPASSWORD\n$MKPASSWORD" | su - "$SITE_NAME" -c "cmk-passwd cmkadmin --stdin"
$STD omd start "$SITE_NAME"
cat <<EOF >~/checkmk.creds
Application-Credentials
Username: cmkadmin
Password: $MKPASSWORD
Site: $SITE_NAME
EOF
msg_ok "Created Service"
cleanup_lxc
motd_ssh
customize