我在 Ubuntu Server 上安装了 Prometheus 和 SNMP 导出器,然后配置使用
/etc/prometheus/prometheus.yml
- job_name: 'Mikrotik'
static_configs:
- targets:
- 10.10.106.210 # Mikrotik device.
metrics_path: /snmp
params:
module: [mikrotik]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 172.16.9.231:9116
但 Prometheus 显示目标设备出现错误服务器返回 HTTP 状态 500 内部服务器错误
一切都是默认的,没有进行其他配置。
手动请求 SNMP 导出器显示
An error has occurred while serving metrics:
error collecting metric Desc{fqName: "snmp_error", help: "Error scraping target", constLabels: {module="mikrotik"}, variableLabels: []}: error walking target 10.10.106.210: error in unmarshalResponse: expected a sequence when unmarshalling a VB, got 25
有人能帮助我吗?我需要提供更多信息吗?