A comprehensive temperature monitoring plugin for Cockpit that provides real-time temperature tracking with graphing capabilities and automatic logging setup.
- Live temperature display with color-coded status indicators
- Dual temperature sources: CPU sensors and thermal zone readings
- Visual status indicators:
- 🟢 Normal (< 60°C)
- 🟡 Warm (60-69°C)
- 🟠 Hot (70-79°C)
- 🔴 Critical (≥ 80°C)
- Chart.js-powered interactive temperature charts
- Multiple time ranges: 1h, 6h, 24h, 7d, all time
- Dual temperature line charts showing both sensors and thermal zone data
- Real-time updates every 30 seconds
- One-click installation of temperature logging system
- Automated cron job for minute-by-minute temperature logging
- CSV format logs stored in
/var/log/temperature/ - Automatic log rotation (30-day retention)
- Smart installation detection and status monitoring
Real-time temperature display with logging status and one-click setup.
Interactive charts with selectable time ranges and historical temperature data.
- Cockpit installed and running
- Node.js (>= 16) for building the plugin
- System with temperature sensors (CPU thermal zones)
-
Clone the repository:
git clone https://github.com/brunoamui/cockpit-temp-plugin.git cd cockpit-temp-plugin -
Install dependencies:
npm install
-
Build the plugin:
npm run build
-
Deploy to Cockpit:
sudo mkdir -p /usr/share/cockpit/cockpit-temp-plugin sudo cp -r dist/* /usr/share/cockpit/cockpit-temp-plugin/ sudo systemctl restart cockpit -
Access the plugin:
- Open Cockpit:
http://your-server:9090 - Navigate to "Temperature Monitor" in the sidebar
- Open Cockpit:
-
Clone and install dependencies:
git clone https://github.com/brunoamui/cockpit-temp-plugin.git cd cockpit-temp-plugin npm install -
Development build with watch mode:
npm run watch
-
Deploy for testing:
# Build and deploy to local Cockpit instance npm run build sudo rsync -av dist/ /usr/share/cockpit/cockpit-temp-plugin/ sudo systemctl restart cockpit
- React 18 with TypeScript
- Chart.js 4 with date-time adapter
- PatternFly 6 for UI components
- Cockpit API for system integration
- ESBuild for bundling
src/
├── app.tsx # Main React application
├── index.html # Plugin entry point
├── manifest.json # Cockpit plugin manifest
└── index.ts # TypeScript entry point
dist/ # Built plugin files
├── index.html
├── index.js
├── manifest.json
└── assets/
The plugin automatically installs a bash script (/usr/local/bin/temp_logger.sh) that:
- Collects temperature from
sensorscommand - Reads thermal zone data from
/sys/class/thermal/thermal_zone0/temp - Logs data in CSV format with timestamps
- Runs every minute via cron job
Temperature status colors and thresholds can be customized in the getTempColor() and getTempStatus() functions in src/app.tsx:
const getTempColor = (temp: number): string => {
if (temp >= 80) return '#dc3545'; // Critical - red
if (temp >= 70) return '#fd7e14'; // Hot - orange
if (temp >= 60) return '#ffc107'; // Warm - yellow
return '#28a745'; // Normal - green
};The logging script can be customized for different:
- Log retention period (default: 30 days)
- Logging frequency (default: every minute)
- Log file location (default:
/var/log/temperature/)
- Linux with systemd
- Raspberry Pi OS
- Ubuntu/Debian
- RHEL/CentOS/Fedora
- CPU temperature sensors accessible via
sensorscommand - Thermal zones in
/sys/class/thermal/ - Standard utilities:
bc,grep,awk,sed
- Check Cockpit is running:
sudo systemctl status cockpit - Verify plugin location:
ls -la /usr/share/cockpit/cockpit-temp-plugin/ - Check manifest.json syntax:
cat /usr/share/cockpit/cockpit-temp-plugin/manifest.json - Restart Cockpit:
sudo systemctl restart cockpit
- Check sensors availability:
sensors - Verify thermal zones:
ls /sys/class/thermal/ - Test thermal reading:
cat /sys/class/thermal/thermal_zone0/temp - Install lm-sensors if needed:
sudo apt install lm-sensors(Debian/Ubuntu)
- Check permissions: Plugin needs sudo access for installation
- Verify cron service:
sudo systemctl status cron - Check script execution:
sudo /usr/local/bin/temp_logger.sh - Review log directory:
ls -la /var/log/temperature/
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature - Make your changes
- Test the plugin with
npm run buildand local deployment - Submit a pull request
- TypeScript for type safety
- ESLint for code linting
- React functional components with hooks
- PatternFly components for consistent UI
# Install dependencies
npm install
# Development build with watch
npm run watch
# Production build
npm run build
# Linting
npm run eslint
# Style checking
npm run stylelintThis project is licensed under the LGPL-2.1 License - see the LICENSE file for details.
- Cockpit Project for the excellent web-based server management platform
- PatternFly for the beautiful UI component library
- Chart.js for the powerful charting capabilities
- React and TypeScript for the solid development foundation
Made with ❤️ for the Cockpit community