Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions apps/contrib/checkmk/README.de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Hetzner Cloud Checkmk

<img src="images/checkmk-logo.png" height="100px">
<br>

[Checkmk](https://checkmk.com/) ist eine umfassende IT-Monitoring-Lösung, die eine einfache und schnelle Überwachung von Netzwerken, Servern, Anwendungen und Cloud-Umgebungen ermöglicht.

[![Deploy to Hetzner Cloud](../../shared/images/deploy_to_hetzner.png)](https://console.hetzner.cloud/deploy/checkmk)

Sie können Checkmk über die [Hetzner Cloud Console](https://console.hetzner.cloud) oder die [Hetzner Cloud API](https://docs.hetzner.cloud/#servers-create-a-server) installieren.

## Getting Started

Erstellen Sie sich Ihren Server wie gewohnt über die [Hetzner Cloud Console](https://console.hetzner.cloud). Alternativ zum Betriebssystem können Sie eine App wählen, die Sie gerne vorinstalliert hätten.

Checkmk wird dann auf dem Server vorinstalliert, aber noch nicht aktiviert.

Um Checkmk zu aktivieren, melden Sie sich bitte auf Ihrem Server an:

- Per _SSH-Key_, falls Sie beim Erstellen Ihres Servers einen angegeben haben
- Per _root-Passwort_, das Sie beim Erstellen Ihres Servers per E-Mail von uns erhalten haben, wenn kein SSH-Key angegeben wurde

Dadurch wird Checkmk aktiviert und die URL der Verwaltungsoberfläche angezeigt.

## Hetzner Cloud API

Anstelle der Hetzner Cloud Console kann zum Einrichten eines Checkmk Servers auch die Hetzner Cloud API genutzt werden.

- Zum Beispiel per Curl-Befehl über die Kommandozeile

```
curl \
-X POST \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"my-checkmk-server", "server_type":"cpx11", "image":"checkmk"}' \
'https://api.hetzner.cloud/v1/servers'
```

- Oder über [hcloud-cli](https://github.com/hetznercloud/cli)

```
hcloud server create --name my-checkmk-server --type cpx11 --image checkmk
```

## Image Inhalt

### Betriebssystem

- [x] Ubuntu 24.04

### Installierte Pakete

Dieses Image enthält Checkmk und alle anderen aufgeführten Anwendungen als Pakete.

| NAME | LIZENZ |
| ---------- | ------------------ |
| Checkmk | GPLv2 |

## Links

Weitere Informationen über die installierten Pakete erhalten Sie in den offiziellen Dokumentationen:

- [Checkmk](https://docs.checkmk.com/latest/en/install_packages_debian.html)

Weitere Informationen über Hetzner Cloud und Hetzner Cloud Apps erhalten Sie in unserer offiziellen Dokumentation:

- [Hetzner Cloud Dokumentation](https://docs.hetzner.com/de/cloud/)
- [Hetzner Cloud API](https://docs.hetzner.cloud/)
69 changes: 69 additions & 0 deletions apps/contrib/checkmk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Hetzner Cloud Checkmk

<img src="images/checkmk-logo.png" height="100px">
<br>

[Checkmk](https://checkmk.com/) is a comprehensive IT monitoring solution that enables easy and fast monitoring of networks, servers, applications, and cloud environments.

[![Deploy to Hetzner Cloud](../../shared/images/deploy_to_hetzner.png)](https://console.hetzner.cloud/deploy/checkmk)

You can install Checkmk via the [Hetzner Cloud Console](https://console.hetzner.cloud) or the [Hetzner Cloud API](https://docs.hetzner.cloud/#servers-create-a-server).

## Getting Started

Create your server as usual using the [Hetzner Cloud Console](https://console.hetzner.cloud). As an alternative to the operating system, you can choose an app that you would like to have pre-installed.

Checkmk will then be preinstalled on the server, but it will not yet be activated.

To activate Checkmk, please log in to your server:

- Use an _SSH key_ if you were provided one when you created your server.
- Use the _root-password_ which we sent to you via email when you created your server; use this if you did not get an SSH key.

This will activate Checkmk and display the URL of the administration interface.

## Hetzner Cloud API

Instead of using the Hetzner Cloud Console, you can use the Hetzner Cloud API to set up a server with Checkmk.

- For example, via a curl command from the command line:

```
curl \
-X POST \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"my-checkmk-server", "server_type":"cpx11", "image":"checkmk"}' \
'https://api.hetzner.cloud/v1/servers'
```

- Or via [hcloud-cli](https://github.com/hetznercloud/cli)

```
hcloud server create --name my-checkmk-server --type cpx11 --image checkmk
```

## Image content

### Operating system

- [x] Ubuntu 24.04

### Installed packages

This image contains Checkmk and all other listed applications as packages.

| NAME | LICENSE |
| ---------- | ------------------ |
| Checkmk | GPLv2 |

## Links

For more information about the installed packages, see the official documentation:

- [Checkmk](https://docs.checkmk.com/latest/en/install_packages_debian.html)

For more information about Hetzner Cloud and Hetzner Cloud Apps, please see our official documentation:

- [Hetzner Cloud Documentation](https://docs.hetzner.com/de/cloud/)
- [Hetzner Cloud API](https://docs.hetzner.cloud/)
63 changes: 63 additions & 0 deletions apps/contrib/checkmk/defaults.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
packer {
required_plugins {
hcloud = {
version = ">= 1.5.0"
source = "github.com/hetznercloud/hcloud"
}
}
}

variable "git-sha" {
type = string
default = "${env("CI_COMMIT_SHA")}"
}

variable "snapshot_name" {
type = string
default = "packer-{{timestamp}}"
}

variable "hcloud_api_token" {
type = string
default = "${env("HCLOUD_TOKEN")}"
sensitive = true
}

variable "hcloud_upgrade_server_type" {
type = string
default = "${env("HCLOUD_SERVER_TYPE")}"
sensitive = true
}

variable "hcloud_server_type" {
type = string
default = "${env("HCLOUD_SERVER_TYPE_BEFORE_UPSCALE")}"
sensitive = true
}

variable "hcloud_server_location" {
type = string
default = "${env("HCLOUD_SERVER_LOCATION")}"
sensitive = true
}

variable "ci_job_id" {
type = string
default = "${env("CI_JOB_ID")}"
sensitive = true
}

source "hcloud" "autogenerated_1" {
image = var.hcloud_image
location = var.hcloud_server_location
server_name = "hcloud-app-builder-${var.app_name}-${var.ci_job_id}"
server_type = var.hcloud_server_type
upgrade_server_type = var.hcloud_upgrade_server_type
snapshot_labels = {
version = var.app_version
slug = "oneclick-${var.app_name}-${var.app_version}-${var.hcloud_image}"
}
snapshot_name = var.snapshot_name
ssh_username = "root"
token = var.hcloud_api_token
}
110 changes: 110 additions & 0 deletions apps/contrib/checkmk/files/opt/hcloud/checkmk_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/bin/bash
#set -x
#
# This will enable GitLab, configure it with user input
# and optionally set up LE.
#
cat <<EOF
______________________________________________________________________
| |
| Welcome to the Chechmk One-Click-App configuration. |
| |
| In this process checkmk will be set up accordingly. |
| You only need to set your desired instance name which will be |
| used to configure checkmk and allow Let's Encrypt to obtain a |
| valid SSL Certificate. |
| Please make sure your Domain exists first. |
| |
| Please enter the Domain in following pattern: checkmk.example.com |
|______________________________________________________________________|
EOF

cmk_user_input(){

while [ -z $instance_name ]
do
read -p "Your Instance Name: " instance_name
done
}

le_user_input(){

while [ -z $domain ]
do
read -p "Your domain name: " domain
done

while [ -z $le_email ]
do
read -p "Your E-Mail address: " le_email
done
}

echo -en "\n"
echo "Please enter your details to set up your new checkmk Instance."

cmk_user_input

while true
do
echo -en "\n"
read -p "Is the instance name correct? [Y/n] " confirm
: ${confirm:="Y"}

case $confirm in
[yY][eE][sS]|[yY] ) break;;
[nN][oO]|[nN] ) unset instance_name; cmk_user_input;;
* ) echo "Please type y or n.";;
esac
done

root_pass=$(openssl rand -base64 12)
omd create $instance_name --admin-password $root_pass

install_certbot(){

while true
do
echo -en "\n"
read -p "Is the domain and email name correct? [Y/n] " confirm
: ${confirm:="Y"}

case $confirm in
[yY][eE][sS]|[yY] ) certbot --apache --agree-tos -m $le_email -d $domain; break;;
[nN][oO]|[nN] ) unset instance_name; le_user_input;;
* ) echo "Please type y or n.";;
esac
done

}

echo -en "\n\n"
echo -en "Do you want to create a Let's Encrypt Certificate for checkmk? \n"
read -p "Note that the domain needs to exist. [Y/n]: " le
: ${le:="Y"}
case $le in
[Yy][eE][sS]|[yY] ) le_user_input; install_certbot;;
[nN][oO]|[nN] ) echo -en "\nSkipping Let's Encrypt.\n";;
* ) echo "Please type y or n.";;
esac

# Remove startup script from .bashrc
sed -i "/chechmk_setup/d" ~/.bashrc

# use domain if available or ip if not
if [ -n "$domain" ]; then
endpoint="$domain"
else
endpoint=$(hostname -I | awk '{print $1}') # Get the first IP address
fi

cat <<EOF
______________________________________________________________________
| |
| Your checkmk instance is now available at: |
| |
| https://$endpoint/$instance_name/
| Username: cmkadmin |
| Password: $root_pass |
|______________________________________________________________________|
EOF
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Create our first instance on first login
cat >> /root/.bashrc <<EOM
chmod +x /opt/hcloud/checkmk_setup.sh
/opt/hcloud/checkmk_setup.sh
EOM
Binary file added apps/contrib/checkmk/images/checkmk-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/checkmk/images/logo_flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/contrib/checkmk/images/logo_full.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions apps/contrib/checkmk/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"description_de": "Checkmk ist eine umfassende IT-Monitoring-Lösung, die eine einfache und schnelle Überwachung von Netzwerken, Servern, Anwendungen und Cloud-Umgebungen ermöglicht.",
"description_en": "Checkmk is a comprehensive IT monitoring solution that enables easy and fast monitoring of networks, servers, applications, and cloud environments.",
"documentation_url": "https://docs.checkmk.com/latest/en/install_packages_debian.html",
"name": "Checkmk",
"os_id": 161547269,
"packages": [
{
"license": "GPLv2",
"name": "Checkmk"
}
],
"recommended_server_type": 22,
"version": "2.4.0p2",
"maintainer": "Dennis Schmalacker <[email protected]>"
}
15 changes: 15 additions & 0 deletions apps/contrib/checkmk/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
#set -x

# Get the Checkmk pubkey to verify the
wget https://download.checkmk.com/checkmk/Check_MK-pubkey.gpg -O /tmp/Check_MK-pubkey.gpg
# Import key
gpg --import /tmp/Check_MK-pubkey.gpg

# Download and add the Checkmk GPG key
wget https://download.checkmk.com/checkmk/${application_version}/check-mk-raw-${application_version}_0.noble_amd64.deb -O /tmp/check-mk-raw-${application_version}_0.noble_amd64.deb
# Install Checkmk
apt install -y /tmp/check-mk-raw-${application_version}_0.noble_amd64.deb

# Install Certbot
apt install -y certbot python3-certbot-apache
Loading