mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-12-16 04:16:15 +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
typehas to besnmpread_intervalas 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
hostnameport(default 161)community(defaultpublic)timeoutas duration like '1s' or '20s' (default '1s')versionSNMP versionX(Xin1,2c,3) (default2c)typeto specifytypetag for the target (defaultnode)type-idto specifytype-idtag for the targetstypeto specifystypetag (sub type) for the targetstype-idto specifystype-idtag for the target
Metric configuration
namecan be an OID or a user-given stringvaluehas to be an OIDunitcan 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