Пример конфигов для Prometheus и snmp_exporter для сбора статистики по SNMP с нескольких устройств.
Для prometheus.yml
######################################################################
- job_name: 'snmp'
static_configs:
- targets:
- XXX.XXX.XXX.XXX # SNMP device.
metrics_path: /snmp
params:
module: [if_mib]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: XXX.XXX.XXX.XXX:9116
#######################################################################
- job_name: 'snmp-1'
static_configs:
- targets:
- XXX.XXX.XXX.XXX
- XXX.XXX.XXX.XXX
metrics_path: /snmp
params:
module: [if_mib1]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: XXX.XXX.XXX.XXX:9116
############################################################
Для snmp.yml
if_mib:
version: 2
auth:
community: c0mmun1ty
walk:
- 1.3.6.1.2.1.2.2.1.10
- 1.3.6.1.2.1.2.2.1.16
- 1.3.6.1.4.1.9.2.1.56
metrics:
- name: IfinOctets
oid: 1.3.6.1.2.1.2.2.1.10.33
type: gauge
- name: IfoutOctets
oid: 1.3.6.1.2.1.2.2.1.16.33
type: gauge
- name: cpmCPUTotal1minRev
oid: 1.3.6.1.4.1.9.2.1.56.0
type: gauge
if_mib1:
version: 2
auth:
community: c0mmun1ty
walk:
- 1.3.6.1.4.1.9.2.1.56
metrics:
- name: cpmCPUTotal1minRev
oid: 1.3.6.1.4.1.9.2.1.56.0
type: gauge
Комментариев нет:
Отправить комментарий