Certainly! Here's a concise summary of the steps to monitor CPU temperature with Zabbix using lm-sensors:
Make sure lm-sensors is installed on the system where you want to monitor CPU temperature. You can typically install it using your system's package manager.
Create a `sensors.conf` file with the necessary `UserParameter` configuration to fetch CPU temperature data. Place this file in a location where Zabbix Agent can access it. For example, /etc/zabbix/zabbix_agent2.d/sensors.conf :
UserParameter=Temperature.CPU1,/usr/share/zabbix-agent/getCPUTemp.sh
Create a shell script (e.g., `getCPUTemp.sh`) with the following content to extract and format the CPU temperature:
#!/bin/bash
sensors | grep -i package | awk -F'[+|°]' '{print $2}' | awk '{printf "%.1f", $1}'
Ensure the script is executable by running:
chmod +x /usr/share/zabbix-agent/getCPUTemp.sh
Restart the Zabbix Agent to apply the changes:
service zabbix-agent restart
In the Zabbix web interface, create a new item for CPU temperature monitoring:
After configuring the item, Zabbix will start collecting CPU temperature data, which you can view and use for monitoring within the Zabbix interface.
By following these steps, you can successfully monitor CPU temperature using Zabbix and lm-sensors.
Resources: