temperature is an important parameter for monitoring the operation of a single machine.
There is no monitoring of the CPU temperature in the Zabbix preset template, so we need to use a custom key to monitor the temperature
Components for which Windows does not have temperature monitoring need to use third-party software speed-fan for temperature reading
Speed-fan Download: http://www.almico.com/sfdownload.php
Simple setup after the installation is complete
Select the items you want to monitor, tick the logged below
Then open the Log tab and tick the Enable
Minimize the Speed-fan will be transferred to the background to run, note that the upper right corner of the X will directly close the software, this should pay attention to ...
After the configuration is complete, a CSV file is generated under the Speed-fan installation directory, which records the temperature data
Next you need to extract the temperature data from the CSV file
Need to use tail and awk this tool, Linux students are certainly familiar with, but Windows did not, we need additional download
tail for Windows: https://en.softonic.com/download/tail-for-windows/windows/post-download?sl=1 //Unzip and put the Tail.exe under the C:\Windows\System32 folder
awk for Windows: HTTPS://SOURCEFORGE.NET/PROJECTS/GNUWIN32/FILES/GAWK/3.1.6-1/GAWK-3.1.6-1-BIN.ZIP/DOWNLOAD?USE_MIRROR=NCHC &r=&use_mirror=ncu //unzip and put the Awk.exe below the Bin folder under the C:\Windows\System32 folder
Determine if tail and awk can be used to open cmd, enter tail--help and awk--help
If the help information is normal, it means that you can use
Tail and awk need to write a batch to extract the temperature data after the installation is complete
-----------------------------------------------
@echo off
CD C:\Program Files\speedfan
Set nowdate=%date:~,4%%date:~5,2%%date:~8,2%
Tail-1 Sflog%nowdate%.csv | awk "{print $}"
------------------------------------------------
Save as Temp.bat file with optional path stored
If you need to test whether the bat file can extract the data correctly, you can add a pause& at the end, and then run it, and then make sure to remove pause after the test is complete, otherwise it will cause the Zabbix data read time-out
You can see that the temperature data has been properly obtained
The next step is to configure the custom key
Open zabbix_agentd.conf
Add a row
Userparameter=cpu_temp,c:\zabbix\temp.bat//cpu_temp is a custom key, followed by the path of the bat
Save, and then restart the Zabbix_agent service (all actions that modify the configuration file must restart the agent service to take effect)
Service-Side settings
Configuration-Host-Select a host that has been configured for temperature monitoring, click on the monitoring item
Create a monitoring item
Configuration, data update interval I choose 5 seconds, other options on-demand, fill in the Completion and click Update
If everything is OK, you will see the green enabled on the Monitor item page
If an error occurs, you can use the command to see if the test can get the data on the Zabbix server
SSH Login Zabbix Server
[Email protected] bin]# Find/-name Zabbix_get
After locating the Zabbix path, the CD enters the Zabbix_get folder and executes
[Email protected] bin]# zabbix_get-s 172.20.12.162-k cpu_temp
To get the temperature right at this point.
If there is an error, according to the wrong answer
The temperature gets normal, and then the chart is added.
Settings, click Add, and then wait to see the temperature map on the monitoring page
---END---
Reference:
https://www.cnblogs.com/justbio/p/5469191.html
https://www.zabbix.com/forum/showthread.php?t=23966
http://blog.51cto.com/qixue/1731696
Zabbix Agent key value: http://ju.outofmemory.cn/entry/76305
Zabbix Agent Template Daquan: http://ju.outofmemory.cn/entry/315279
Zabbix adding monitoring of the Windows client CPU temperature