代码拉取完成,页面将自动刷新
snmpwalk -v 2c -c synology 192.168.5.175 1.3.6.1.4.1.6574.1.2
查看cpu温度的指标(192的是我本地的ip,-v表示协议版本,-c表示社群,根据你群晖里面设置的不同而不同),发现一切正常,显示‘SYNOLOGY-SYSTEM-MIB::temperature.0 = INTEGER: 58’,和系统面板中显示的温度相同。cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/snmp.conf
/etc/netdata/go.d/snmp.conf
,添加相关监控指标。下面给出我的配置:jobs:
- name: nas
update_every: 1
hostname: 192.168.5.175
community: synology
options:
version: 2
charts:
- id: "temperature"
title: "cpu_temperature"
units: "Celsius"
type: "line"
family: "cpu"
dimensions:
- name: "temperature"
oid: "1.3.6.1.4.1.6574.1.2.0"
algorithm: "absolute"
相关的配置说明在这里,根据自己的需要可以选择不同的指标,例如硬盘温度等。oid号可以在这里查看。理论上任何指标都可以监控得到,或者可以实现远程服务器的监控,只需要写外网的ip就可以,同时外网的服务器支持snmp。
cd /usr/libexec/netdata/plugins.d/ && ./go.d.plugin -d -m snmp
不应该出现error,我的显示为:
CHART 'snmp_nas.temperature' '' 'cpu_temperature' 'Celsius' 'cpu' 'snmp.temperature' 'line' '70000' '1' '' 'go.d' 'snmp'
CLABEL '_collect_job' 'nas' '1'
CLABEL_COMMIT
DIMENSION 'temperature' 'temperature' 'absolute' '1' '1' ''
BEGIN 'snmp_nas.temperature'
SET 'temperature' = 64
END
希望能帮到其他人,我也是研究了几个小时才解决的。