On Debian 13:
sudo apt update
sudo apt install -y nagios4 nagios-plugins-standard
On RHEL 10:
sudo dnf install -y epel-release
sudo dnf install -y nagios nagios-plugins-all
On Debian 13:
sudo apt update
sudo apt install -y thruk
On RHEL 10:
sudo dnf install -y epel-release
sudo dnf install -y thruk
On Debian 13:
wget -O - https://labs.consol.de/repo/stable/RPM-GPG-KEY-labs-consol-stable | sudo apt-key add -
echo "deb https://labs.consol.de/repo/stable/debian $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/labs-consol-stable.list
sudo apt update
sudo apt install -y thruk
On RHEL 10:
sudo rpm -Uvh https://labs.consol.de/repo/stable/RPM-GPG-KEY-labs-consol-stable
sudo tee /etc/yum.repos.d/labs-consol-stable.repo >/dev/null <<'EOF'
[labs-consol-stable]
name=Labs ConSol Stable Repository
baseurl=https://labs.consol.de/repo/stable/rhel/$releasever/$basearch
enabled=1
gpgcheck=1
gpgkey=https://labs.consol.de/repo/stable/RPM-GPG-KEY-labs-consol-stable
EOF
sudo dnf install -y thruk
Edit Thruk configuration:
sudo nano /etc/thruk/thruk.conf
Key settings:
# Backend configuration
backend_config = [
{
'peerkey' => 'secret',
'peertype' => 'local',
'config' => '/etc/nagios4/nagios.cfg'
}
]
# Authentication
auth_type = 'htpasswd'
auth_config = '/etc/thruk/htpasswd'
# Session timeout
session_timeout = 7200
Create admin user:
sudo htpasswd -c /etc/thruk/htpasswd thrukadmin
Add additional users:
sudo htpasswd /etc/thruk/htpasswd user1
On Debian 13:
sudo a2enmod rewrite
sudo a2enmod headers
sudo systemctl restart apache2
Thruk typically auto-configures Apache. Verify:
ls -la /etc/apache2/conf-enabled/thruk.conf
On RHEL 10:
sudo systemctl restart httpd
On Debian 13:
sudo systemctl enable --now thruk
sudo systemctl enable --now nagios4
On RHEL 10:
sudo systemctl enable --now thruk
sudo systemctl enable --now nagios
Verify services:
sudo systemctl status thruk
sudo systemctl status nagios
On UFW:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
On firewalld:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Open http://SERVER_IP/thruk to access the Thruk web interface.
Log in with username thrukadmin and the password you set.
Thruk can connect to multiple monitoring backends:
Edit /etc/thruk/thruk.conf:
backend_config = [
{
'peerkey' => 'secret1',
'peertype' => 'local',
'config' => '/etc/nagios4/nagios.cfg'
},
{
'peerkey' => 'secret2',
'peertype' => 'remote',
'host' => '192.168.1.100',
'port' => 6558
}
]
For better performance, enable LMD:
On Debian 13:
sudo apt install -y lmd
Edit Nagios configuration /etc/nagios4/nagios.cfg:
broker_module=/usr/lib/nagios4/brokers/lmd/lmd.so
Restart Nagios:
sudo systemctl restart nagios4
Update Thruk configuration:
backend_config = [
{
'peerkey' => 'secret',
'peertype' => 'lmd',
'socket' => 'tcp:localhost:6557'
}
]
Edit /etc/thruk/thruk.conf:
# Company logo
company_logo = '/thruk/images/company_logo.png'
# Default page
default_page = 'overview'
# Show navigation bar
show_navigation = 1
# Theme
theme = 'dark'
Thruk supports various notification methods:
Thruk provides a REST API:
# Get host status
curl -u user:password http://localhost/thruk/cgi-bin/status-json.xsd?host=server1
# Get service status
curl -u user:password http://localhost/thruk/cgi-bin/service-json.xsd?host=server1&service=HTTP
# Acknowledge problem
curl -u user:password -X POST \
http://localhost/thruk/thruk/cgi-bin/cmd.cgi \
-d 'cmd_typ=96&host=server1&com_data=Acknowledged&submit=Commit'
Use Thruk’s JSON output with Grafana:
Configure webhook in /etc/thruk/thruk.conf:
notification_commands = [
{
'command' => 'notify-slack',
'handler' => '/usr/local/bin/slack-notify.sh'
}
]
See Thruk Hardening.
Need professional assistance with your monitoring infrastructure? Our team provides:
Get in touch: office@linux-server-admin.com | Contact Page
Prefer automation? See Thruk Ansible Setup for an example playbook.
Prefer containers? See Thruk Docker Setup.
See Thruk Configuration for configuration guidance.
See Thruk Security for hardening guidance.