標籤:
ZabbixCPU溫度監視
1, lm_sensors安裝
#yum install lm_sensors
…
#sensors-detect
出來的選項全部選yes
重啟伺服器
2, lm_sensors出力結果調整
命令sensors可以顯示組件溫度(機器不同顯示的內容也不同)
[[email protected] sbin]# sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +40°C (high = +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1: +37°C (high = +100°C)
命令sensors –u <組件編號>可以單獨取出指定組件的溫度
[[email protected] sbin]# sensors -u coretemp-isa-0000
coretemp-isa-0000
Adapter: ISA adapter
Core 0: 40.00 (temp1)
temp1_crit: 100.00 (temp1_crit)
temp1_crit_alarm: 0.00 (temp1_crit_alarm)
把出力結果加工(根據實際情況加工)
例:
[[email protected] etc]# sensors -u coretemp-isa-0000 |grep Core |cut -d" " -f3|cut -d"." -f1
40
[[email protected] etc]# sensors -u coretemp-isa-0001 |grep Core |cut -d" " -f3|cut -d"." -f1
37
3, Zabbix_agentd.conf設定
在zabbix_agentd.conf中加入UserParameter
[[email protected] etc]# vi /usr/local/etc/zabbix_agentd.conf
……
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=<key>,<shell command>
# See ‘zabbix_agentd‘ directory for examples.
#
# Mandatory: no
# Default:
# UserParameter=
UserParameter=cputemp.core0,/usr/bin/sensors -u coretemp-isa-0000 |grep Core |cut -d" " -f3|cut -d"." -f1
UserParameter=cputemp.core1,/usr/bin/sensors -u coretemp-isa-0001 |grep Core |cut -d" " -f3|cut -d"." -f1
……
重啟zabbix_agentd
[[email protected] etc]# /sbin/service zabbix_agentd restart
Stopping Zabbix Agent: [ OK ]
Starting Zabbix Agent: [ OK ]
4, Zabbix伺服器端設定
建立item,如,未顯示的預設設定就好
建立trigle,
例:
就可以監視起來了
ZabbixCPU溫度監視-Centos