zabbix监控windows服务器CPU温度

一、准备工具

instspeedfan452.exe   --->  https://filehippo.com/zh/download_speedfan/

tail-for-windows.zip

gawk-3.1.6-1-bin.zip

二、windows服务器操作

1.拷贝instspeedfan452.exe tail-for-windows.zip gawk-3.1.6-1-bin.zip到E:\安装包下

2.运行instspeedfan452.exe安装到E:\已安装\speedfan下   #监控工具

3.解压tail-for-windows.zip,拷贝E:\安装包\tail-for-windows\tail.exe到C:\Windows\System32目录下     #安装tail命令,测试运行cmd,输入tail --help

4.解压gawk-3.1.6-1-bin.zip,拷贝E:\安装包\gawk-3.1.6-1-bin\bin\awk.exe到C:\Windows\System32目录下   #安装awk命令,测试cmd,输入awk --help

5.运行SpeedFan4.52,查看到当前CPU个数温度,点击Configure

点击Temperatures页面的CPU1,Logged前打勾;CPU2,Logged前打勾;点击Log页面,Enabled前打勾;确定。会在E:\已安装\speedfan目录下生成文件SFLog20180706.csv

6.建立CPU1TEMP12.bat   ##可在最后一行加入pause&,然后运行CPU1TEMP12.bat,看是否能显示温度,记得pause&要删除

@echo off
e:
cd 已安装
cd speedfan
Set nowdate=%date:~,4%%date:~5,2%%date:~8,2%
tail -1 SFLog%nowdate%.csv | awk "{print $2}"

建立CPU2TEMP12.bat

@echo off
e:
cd 已安装
cd speedfan
Set nowdate=%date:~,4%%date:~5,2%%date:~8,2%
tail -1 SFLog%nowdate%.csv | awk "{print $3}"

7.编辑E:\安装包\zabbix_agents\conf\zabbix_agentd.win.conf文件  

UnsafeUserParameters=1   #允许自定义key

UserParameter=cpu-temp,E:\已安装\CPU1TEMP12.bat
UserParameter=cpu-temp2,E:\已安装\CPU2TEMP12.bat      #定义key

8.重启zabbix Agent服务

三、Zabbix监控页面操作(此版本为2.2.0)

1.组态--主机--xxxx主机--项目--创建监控项CPU温度121和CPU温度122

2.创建触发器CPU温度121和CPU温度122

3.创建图形

查看一下监控温度图形

猜你喜欢

转载自www.cnblogs.com/gz-eternity/p/9274222.html