Files
ProxmoxVE/ct/checkmk.sh
T

64 lines
2.2 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
2024-12-20 10:01:32 +01:00
# Author: Michel Roegl-Brunner (michelroegl-brunner)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://checkmk.com/
APP="checkmk"
var_tags="${var_tags:-monitoring}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-6}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-no}"
var_unprivileged="${var_unprivileged:-1}"
2024-12-20 10:01:32 +01:00
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
2026-04-29 14:23:59 +02:00
if ! command -v omd &>/dev/null; then
2024-12-20 10:01:32 +01:00
msg_error "No ${APP} Installation Found!"
exit
fi
2026-04-29 14:23:59 +02:00
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%%+*}"
2026-04-29 14:23:59 +02:00
msg_info "Updating checkmk"
2025-09-20 18:26:28 +02:00
$STD omd stop monitoring
$STD omd -f rm monitoringbackup 2>/dev/null || true
2025-09-20 18:26:28 +02:00
$STD omd cp monitoring monitoringbackup
curl_download "/opt/checkmk.deb" "https://download.checkmk.com/checkmk/${RELEASE}/check-mk-community-${RELEASE}_0.$(get_os_info codename)_amd64.deb"
2026-04-29 14:23:59 +02:00
$STD apt install -y /opt/checkmk.deb
OMD_VERSION=$(omd versions 2>/dev/null | grep "^${RELEASE}" | awk '{print $1}')
if [[ -z "${OMD_VERSION}" ]]; then
msg_error "Could not find installed OMD version for release ${RELEASE}"
exit 1
fi
$STD omd --force -V "${OMD_VERSION}" update --conflict=install monitoring
2025-09-20 18:26:28 +02:00
$STD omd start monitoring
$STD omd -f rm monitoringbackup
$STD omd cleanup
rm -rf /opt/checkmk.deb
2026-04-29 14:23:59 +02:00
msg_ok "Updated checkmk"
msg_ok "Updated successfully!"
2024-12-20 10:01:32 +01:00
exit
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
2024-12-20 10:01:32 +01:00
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}/monitoring${CL}"