Thruk is a multibackend monitoring web interface for Nagios, Icinga, Naemon, and Shinken. It provides a modern, responsive interface for viewing monitoring status, acknowledging problems, and managing monitoring configurations.
| File/Directory | Path | Purpose |
|---|---|---|
| Main config | /etc/thruk/thruk.conf |
Main Thruk configuration |
| Local config | /etc/thruk/thruk_local.conf |
Local overrides |
| Backends | /etc/thruk/backends.d/ |
Backend configurations |
| Authentication | /etc/thruk/htpasswd |
User credentials |
| Templates | /usr/share/thruk/templates/ |
UI templates |
| Static files | /usr/share/thruk/htdocs/ |
Web assets |
| Logs | /var/log/thruk/ |
Log files |
| Sessions | /var/lib/thruk/sessions/ |
Session storage |
| Web config | /etc/apache2/sites-available/thruk.conf |
Apache configuration |
# /etc/thruk/thruk.conf
###############################################################################
# GENERAL SETTINGS
###############################################################################
# Thruk installation directory
thruk_dir=/usr/share/thruk
# Log file
log_file=/var/log/thruk/thruk.log
# Log level (error, warn, info, debug)
log_level=warn
# PID file
pid_file=/var/run/thruk/thruk.pid
# Temporary directory
tmp_dir=/var/tmp/thruk
# Session directory
session_dir=/var/lib/thruk/sessions
# Session lifetime (seconds)
session_lifetime=7200
# Timezone
timezone=UTC
# Language
language=en
# Available languages
languages=en,de,fr,es,it,pt,ru,zh,ja
###############################################################################
# BACKEND SETTINGS
###############################################################################
# Backend configuration directory
backend_config_dir=/etc/thruk/backends.d
# Default backend
default_backend=local
# Backend timeout (seconds)
backend_timeout=30
# Backend connection timeout (seconds)
backend_connect_timeout=10
# Backend retry count
backend_retry_count=3
# Backend retry delay (seconds)
backend_retry_delay=1
# Enable backend caching
backend_caching=1
# Backend cache lifetime (seconds)
backend_cache_lifetime=60
###############################################################################
# AUTHENTICATION SETTINGS
###############################################################################
# Authentication type (htpasswd, ldap, omd, shibboleth, remote_user)
auth_type=htpasswd
# htpasswd file
htpasswd_file=/etc/thruk/htpasswd
# Authentication realm
auth_realm=Thruk Monitoring
# Enable authentication
auth_enabled=1
# Allow anonymous read access
auth_anonymous_read=0
# Default user role
auth_default_role=readonly
# User roles
# admin: full access
# operator: acknowledge, schedule checks
# readonly: view only
# guest: limited view
# LDAP authentication settings
ldap_host=ldap.example.com
ldap_port=389
ldap_version=3
ldap_tls=0
ldap_binddn=cn=admin,dc=example,dc=com
ldap_bindpw=LdapPassword123!
ldap_basedn=dc=example,dc=com
ldap_filter=(uid=%s)
ldap_userattr=uid
ldap_groupattr=cn
ldap_group=thruk-users
ldap_admin_group=thruk-admins
###############################################################################
# AUTHORIZATION SETTINGS
###############################################################################
# Enable authorization
authz_enabled=1
# Contact groups for authorization
# Format: contactgroup=role
contactgroups_admins=admin
contactgroups_ops=operator
contactgroups_users=readonly
# Host groups for authorization
# Format: hostgroup=role
#hostgroups_servers=admin
#hostgroups_network=operator
# Service groups for authorization
# Format: servicegroup=role
#servicegroups_critical=admin
###############################################################################
# UI SETTINGS
###############################################################################
# Page title
page_title=Thruk Monitoring
# Page logo
page_logo=/thruk/images/thruk_logo.png
# Page favicon
page_favicon=/thruk/images/favicon.ico
# Show company name
show_company=1
company_name=Company Name
# Show hostname in title
show_hostname_in_title=1
# Default view
default_view=tac
# Refresh interval (seconds)
refresh_interval=90
# Auto-refresh
auto_refresh=1
# Show navigation menu
show_navigation=1
# Show search
show_search=1
# Show bookmarks
show_bookmarks=1
# Show theme selector
show_theme_selector=1
# Show language selector
show_language_selector=1
# Default theme
theme=default
# Available themes
themes=default,dark,highcontrast
###############################################################################
# NOTIFICATION SETTINGS
###############################################################################
# Enable notifications
notifications_enabled=1
# Notification sound
notification_sound=1
notification_sound_file=/thruk/sounds/notification.wav
# Desktop notifications
desktop_notifications=1
# Email notifications
email_notifications=0
email_from=thruk@example.com
email_to=admin@example.com
email_smtp_host=smtp.example.com
email_smtp_port=587
email_smtp_user=thruk@example.com
email_smtp_password=EmailPassword123!
email_smtp_tls=1
###############################################################################
# PERFORMANCE SETTINGS
###############################################################################
# Enable caching
cache_enabled=1
# Cache directory
cache_dir=/var/cache/thruk
# Cache lifetime (seconds)
cache_lifetime=60
# Enable compression
compression_enabled=1
# Enable gzip
gzip_enabled=1
# Max concurrent backend connections
max_backend_connections=10
# Query timeout (seconds)
query_timeout=30
###############################################################################
# SECURITY SETTINGS
###############################################################################
# Enable CSRF protection
csrf_protection=1
# CSRF token lifetime (seconds)
csrf_token_lifetime=3600
# Enable XSS protection
xss_protection=1
# Clickjacking protection
clickjacking_protection=1
# Content Security Policy
csp_enabled=0
csp_policy="default-src 'self'"
# Session cookie secure
session_cookie_secure=1
# Session cookie httponly
session_cookie_httponly=1
# Session cookie samesite
session_cookie_samesite=Lax
# Allowed IPs (comma-separated, empty = all)
allowed_ips=
# Denied IPs (comma-separated)
denied_ips=
# Rate limiting
rate_limit_enabled=1
rate_limit_requests=100
rate_limit_window=60
###############################################################################
# EXTENSIONS
###############################################################################
# Enable extensions
extensions_enabled=1
# Extension directory
extension_dir=/usr/share/thruk/extensions
# Enabled extensions
#extensions=reporting,graphing,business
###############################################################################
# MISC SETTINGS
###############################################################################
# Show version
show_version=1
# Show documentation link
show_doc_link=1
# Show support link
show_support_link=1
# Support URL
support_url=https://www.thruk.org/documentation.html
# Documentation URL
doc_url=https://www.thruk.org/documentation.html
# Enable demo mode
demo_mode=0
# Demo user
demo_user=demo
# Demo password
demo_password=demo
# Enable test mode
test_mode=0
# /etc/thruk/backends.d/local.conf
# Backend name
name=local
# Backend type (livestatus, nagios, icinga, naemon, shinken)
type=livestatus
# Livestatus socket path
socket=/var/nagios/rw/live
# Or TCP connection
#socket=tcp:localhost:6558
# Backend priority (lower = higher priority)
priority=1
# Enable backend
enabled=1
# Read-only mode
readonly=0
# Backend timeout
timeout=30
# Connection timeout
connect_timeout=10
# Retry count
retry_count=3
# Retry delay
retry_delay=1
# Peer key (for distributed monitoring)
#peer_key=local
# Peer address (for distributed monitoring)
#peer_address=192.168.1.10
# Peer port (for distributed monitoring)
#peer_port=6558
# /etc/thruk/backends.d/remote.conf
# Remote backend
name=remote-datacenter
# Backend type
type=livestatus
# TCP connection to remote
socket=tcp:192.168.1.100:6558
# Priority
priority=2
# Enable backend
enabled=1
# Read-only mode
readonly=1
# Timeout
timeout=60
# Connection timeout
connect_timeout=30
# Retry count
retry_count=5
# Retry delay
retry_delay=5
# TLS settings
#tls=1
#tls_ca_file=/etc/thruk/ssl/ca.crt
#tls_cert_file=/etc/thruk/ssl/client.crt
#tls_key_file=/etc/thruk/ssl/client.key
# /etc/thruk/thruk_local.conf
# Local configuration overrides
# Authentication
auth_type=htpasswd
htpasswd_file=/etc/thruk/htpasswd
# Backend
default_backend=local
# UI
page_title=Company Monitoring
company_name=Company Name
# Security
session_cookie_secure=1
csrf_protection=1
# Logging
log_level=warn
log_file=/var/log/thruk/thruk.log
# Create htpasswd file
htpasswd -cb /etc/thruk/htpasswd admin AdminPassword123!
# Add user
htpasswd -b /etc/thruk/htpasswd operator OperatorPassword123!
# Add readonly user
htpasswd -b /etc/thruk/htpasswd viewer ViewerPassword123!
# List users
cat /etc/thruk/htpasswd
# Role-based access control
# /etc/thruk/thruk.conf
# Admin role - full access
contactgroups_admins=admin
# Operator role - acknowledge, schedule
contactgroups_ops=operator,ops-team
# Readonly role - view only
contactgroups_users=readonly,viewers
# Custom role mapping
#contactgroups_custom=custom-role
# Validate Thruk configuration
thruk_validate_config
# Check backend connections
thruk_backend_test
# Test authentication
thruk_auth_test
# Restart Thruk
sudo systemctl restart thruk
# Check status
sudo systemctl status thruk
# View logs
sudo journalctl -u thruk -f
sudo tail -f /var/log/thruk/thruk.log
# Restart Apache
sudo systemctl restart apache2
# Clear Thruk cache
rm -rf /var/cache/thruk/*
# Clear sessions
rm -rf /var/lib/thruk/sessions/*
# Set permissions
chown -R www-data:www-data /var/cache/thruk /var/lib/thruk/sessions
chmod -R 755 /var/cache/thruk /var/lib/thruk/sessions
# Check service status
sudo systemctl status thruk
# Check if listening
sudo netstat -tlnp | grep thruk
# Check running processes
ps aux | grep thruk
# Access web interface
curl http://localhost/thruk/
# Check CGI status
curl http://localhost/thruk/cgi-bin/status.cgi
# Check API
curl http://localhost/thruk/thruk/api/1.0/status.json
# Test backend connection
thruk_backend_test
# List backends
thruk_backend_list
# Check backend status
curl http://localhost/thruk/thruk/api/1.0/backends.json
Every deployment is unique. We provide consulting for:
Get personalized assistance: office@linux-server-admin.com | Contact Page