openITCOCKPIT is an enterprise-grade monitoring solution based on Nagios Core and Icinga. It provides a modern web interface, distributed monitoring, and reporting capabilities.
| File/Directory | Path | Purpose |
|---|---|---|
| Main config | /etc/openitcockpit/app.php |
Application configuration |
| Database | /etc/openitcockpit/database.php |
Database configuration |
| Monitoring | /etc/openitcockpit/monitoring/ |
Monitoring configs |
| Commands | /etc/openitcockpit/commands/ |
Command definitions |
| Templates | /etc/openitcockpit/templates/ |
Check templates |
| Logs | /var/log/openitcockpit/ |
Log files |
| Web config | /etc/nginx/sites-available/openitcockpit |
Nginx configuration |
<?php
// /etc/openitcockpit/app.php
return [
// Application name
'app_name' => 'openITCOCKPIT',
// Debug mode
'debug' => false,
// Security settings
'security' => [
'salt' => 'YourSecretSaltHere',
'cipher' => 'AES-256-CBC',
],
// Session settings
'session' => [
'lifetime' => 7200,
'secure' => true,
'httponly' => true,
],
// Email settings
'email' => [
'transport' => 'smtp',
'host' => 'smtp.example.com',
'port' => 587,
'username' => 'openitcockpit@example.com',
'password' => 'EmailPassword123!',
'encryption' => 'tls',
'from' => ['address' => 'openitcockpit@example.com', 'name' => 'openITCOCKPIT'],
],
// API settings
'api' => [
'enabled' => true,
'rate_limit' => 100,
],
];
<?php
// /etc/openitcockpit/database.php
return [
'default' => 'mysql',
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => 'localhost',
'port' => 3306,
'database' => 'openitcockpit',
'username' => 'openitcockpit',
'password' => 'SecureDbPassword123!',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
],
],
];
<?php
// Monitoring backend settings
return [
'backend' => [
'type' => 'nagios', // nagios or icinga
'config_path' => '/etc/nagios/',
'command_file' => '/var/nagios/rw/nagios.cmd',
'status_file' => '/var/nagios/status.dat',
],
// Check intervals
'intervals' => [
'host_check' => 300,
'service_check' => 60,
'retry_interval' => 30,
],
// Notification settings
'notifications' => [
'enabled' => true,
'interval' => 1800,
],
];
<?php
// Check command templates
return [
'commands' => [
'check_host_alive' => [
'command_line' => '/usr/lib/nagios/plugins/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5',
],
'check_http' => [
'command_line' => '/usr/lib/nagios/plugins/check_http -I $HOSTADDRESS$ -u $ARG1$',
],
'check_ssh' => [
'command_line' => '/usr/lib/nagios/plugins/check_ssh -H $HOSTADDRESS$',
],
'check_disk' => [
'command_line' => '/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$',
],
],
];
<?php
return [
'notifications' => [
'email' => [
'enabled' => true,
'recipients' => ['admin@example.com', 'ops@example.com'],
'subject_template' => '[openITCOCKPIT] $NOTIFICATIONTYPE$ Alert: $HOSTNAME$',
'body_template' => 'Host: $HOSTNAME$\nState: $HOSTSTATE$\nInfo: $HOSTOUTPUT$',
],
'slack' => [
'enabled' => false,
'webhook_url' => 'https://hooks.slack.com/services/XXX/YYY/ZZZ',
'channel' => '#alerts',
],
],
];
# Validate application config
php /var/www/openitcockpit/bin/cake schema_cache check
# Validate monitoring config
sudo nagios -v /etc/nagios/nagios.cfg
# Restart openITCOCKPIT
sudo systemctl restart openitcockpit
# Restart monitoring backend
sudo systemctl restart nagios
# Check status
sudo systemctl status openitcockpit
sudo systemctl status nagios
# Run migrations
php /var/www/openitcockpit/bin/cake migrations migrate
# Clear cache
php /var/www/openitcockpit/bin/cake schema_cache clear
# Check application status
sudo systemctl status openitcockpit
# View logs
sudo tail -f /var/log/openitcockpit/app.log
# Access web interface
curl http://localhost/openitcockpit
# Check API
curl http://localhost/openitcockpit/api/status
Squeezing every bit of performance from your OpenITCOCKPIT installation? Our experts help with:
Optimize your setup: office@linux-server-admin.com | Contact Us