Admin Tools Overview
Comprehensive guide to Lambda Softworks' system administration and monitoring scripts.
The Admin Tools package provides comprehensive system monitoring, alerting, and management capabilities for Linux systems. These scripts help maintain system health and optimize performance.
Main Scripts
1. system-monitor.sh
Real-time system monitoring and alerting:
# Interactive monitoring dashboard ./system-monitor.sh # Background monitoring with alerts ./system-monitor.sh --daemon --config /etc/monitor-config.yml # Quick system health check ./system-monitor.sh --health-check
Options:
--daemon Run in background mode --alert-level Set alert threshold (low|medium|high) --metrics Specify metrics to monitor --interval Check interval in seconds --notify Email or Slack notification settings
2. resource-manager.sh
Resource usage monitoring and management:
# Check current resource usage ./resource-manager.sh --status # Set resource limits ./resource-manager.sh --limit-cpu 80 --limit-memory 90 # Generate resource report ./resource-manager.sh --report daily
3. log-analyzer.sh
Advanced log analysis and reporting:
# Real-time log monitoring ./log-analyzer.sh --follow /var/log/syslog # Generate log summary ./log-analyzer.sh --summary --last 24h # Search for specific patterns ./log-analyzer.sh --pattern "error|failed" --services nginx,mysql
Configuration
Example monitoring configuration:
# /etc/monitor-config.yml monitoring: metrics: - cpu_usage - memory_usage - disk_usage - load_average - network_traffic - open_files - process_count thresholds: cpu: warning: 80 critical: 90 memory: warning: 85 critical: 95 disk: warning: 85 critical: 90 services: - name: nginx port: 80 process: nginx - name: mysql port: 3306 process: mysqld alerts: email: enabled: true recipients: - admin@company.com - oncall@company.com slack: enabled: true webhook: https://hooks.slack.com/... channel: "#server-alerts" logging: level: info file: /var/log/system-monitor.log rotate: daily retain: 30
Common Use Cases
1. Production Server Monitoring
./system-monitor.sh \ --daemon \ --metrics cpu,memory,disk,network \ --alert-level medium \ --notify slack \ --interval 60
2. Log Analysis
./log-analyzer.sh \ --services nginx,php-fpm \ --pattern "error|failed|critical" \ --last 6h \ --report-format html \ --output /var/www/reports/
3. Resource Optimization
./resource-manager.sh \ --optimize \ --target-services mysql,nginx \ --apply-recommendations
Best Practices
Monitoring Setup
- Set appropriate thresholds
- Configure multiple notification methods
- Use different alert levels for different environments
Resource Management
- Regular performance audits
- Implement automated responses
- Document baseline metrics
Log Management
- Centralize log collection
- Set up log rotation
- Regular log analysis
Troubleshooting
Common issues and solutions:
High Resource Usage
# Identify top consumers ./resource-manager.sh --top-processes # Generate optimization report ./resource-manager.sh --analyze-usage
Alert Storm
# Adjust thresholds ./system-monitor.sh --reconfigure-alerts # Check alert history ./system-monitor.sh --alert-history
Service Issues
# Service health check ./system-monitor.sh --service-check all # Auto-recovery attempt ./system-monitor.sh --auto-recover
Security Features
Access Control
- Role-based access
- Audit logging
- Secure remote monitoring
Data Protection
- Encrypted metrics storage
- Secure communication
- Data retention policies