mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-11-10 04:27:25 +01:00
1.8 KiB
1.8 KiB
SNMP Receiver
"<name>": {
"type": "snmp",
"read_interval": "30s",
"targets" : [{
"hostname" : "host1.example.com",
"port" : 161,
"community": "public",
"timeout" : 1,
}],
"metrics" : [
{
"name": "sensor1",
"value": "1.3.6.1.2.1.1.4.0",
"unit": "1.3.6.1.2.1.1.7.0",
},
{
"name": "1.3.6.1.2.1.1.2.0",
"value": "1.3.6.1.2.1.1.4.0",
"unit": "mb/s",
}
]
}
The snmp
receiver uses gosnmp to read metrics from network-attached devices.
The configuration of SNMP is quite extensive due to it's flexibility.
Configuration
type
has to besnmp
read_interval
as duration like '1s' or '20s' (default '30s')
For the receiver, the configuration is split in two parts:
Target configuration
Each network-attached device that should be queried. A target consits of
hostname
port
(default 161)community
(defaultpublic
)timeout
as duration like '1s' or '20s' (default '1s')version
SNMP versionX
(X
in1
,2c
,3
) (default2c
)type
to specifytype
tag for the target (defaultnode
)type-id
to specifytype-id
tag for the targetstype
to specifystype
tag (sub type) for the targetstype-id
to specifystype-id
tag for the target
Metric configuration
name
can be an OID or a user-given stringvalue
has to be an OIDunit
can be empty, an OID or a user-given string
If a OID is used for name
or unit
, the receiver will use the returned values to create the output metric. If there are any issues with the returned values, it uses the OID
.
Testing
For testing an SNMP endpoint and OIDs, you can use scripts/snmpReceiverTest