How to register an SNMP device type
In the current setting, a type of device using SNMP is configured by uploading MIBs and defining a MeasurementDevice custom resource.
The operator generates SNMP module config (snmp.yml) and triggers a reload of chantico-snmp.
In our First use-case (see goal.md) this corresponds to the registerPDU phase.
- Upload the MIBS:
- If you have created the cluster using the local development setup howto, you can use
make cluster-mibsto copy all the MIB files in thedev/mibsfolder into the persistent volume claim. - Otherwise, browse to the filebrowser. Either use the port-forward from the kind-config (if you have a KinD cluster) or use the port-forward command:
- Login with (user: admin, password: admin)
- Upload your MIBS files in
snmp/mibs
- If you have created the cluster using the local development setup howto, you can use
- Create the MeasurementDevice matching the required type of MeasurementDevice
-
Create a
measurement_device.yamlfile. The SNMP authentication is provided throughspec.authFrom, which reads it from aSecret(see Providing SNMP authentication for other options): -
Apply the yaml file
-
- Verify the new device setting
- Wait for the SNMP generator job to complete
- The generated config is stored on the shared volume at
snmp/yml/snmp.yml. - Port-forward the SNMP exporter
- Check that the config (http://localhost:9116/config) include the registered device as a module
Providing SNMP authentication
The SNMP Auth can either be provided directly in the MeasurementDevice resource using spec.authFrom.value,
or it can be sourced from a Secret or ConfigMap using spec.authFrom.valueFrom. Regardless of
the resolved value must be a valid YAML document containing the SNMP
authentication parameters, using the same format as an entry under auths in
the SNMP exporter generator
configuration.
The value can come from exactly one of three sources:
- A
Secret(recommended for credentials such as SNMPv3 passwords): - A
ConfigMap: - Inline (only suitable for non-sensitive settings):
Metric name disambiguation
If two metrics have the same name, there are two methods to disambiguate. Let’s take the example of the tnoPduEnergyValue metric present in both ./dev/mibs/TNO-ANOTHERPDU-MIB.txt, and ./dev/mibs/TNO-PDU-MIB.txt:
- the user can fully qualify the “path” within the MIB tree via human readable language
TNO-PDU-MIB::tnoPduEnergyValue - the user can fully qualify the “path” within the MIB tree via the OID
1.3.6.1.4.99999.1