How to run the mock snmp device
The SNMP mock
The SNMP mock is an UDP server mocking a device using SNMP with a mock MIB file
(./dev/mibs/TNO-PDU-MIB.txt). It provides random energy values for the
following metrics: tnoPduEnergyValue and tnoPduPowerValue. This file details
how to set up the mock device, and how to subsequently run a demo with it
including both the PhysicalMeasurement and MeasurementDevice custom
resources.
Requirements
Ensure you have followed the installation guidance or the instructions in How to set up the local development environment to set up a production-like or local development environment. After this:
- The cluster is running.
- The controller is running (locally via
make runor in-cluster).
Manual installation
Note that the SNMP mock is part of the local development environment, so you do not need to follow the manual installation steps here if you are fine with the default latest version of the mock image. Only in cases where you need to update the mock image during development, or when deploying the mock into a separate cluster, follow the manual installation steps below. Otherwise, skip to the section on running the demo with the mock SNMP device.
Load the snmp-mock image into the kind environment
To obtain the latest SNMP mock image, pull it from the GitHub Container Registry and load it into the kind cluster:
Alternatively, you can build the image locally and load it into the kind cluster:
Apply the mock to Kubernetes
Running the demo with the mock SNMP device
Querying the chantico-snmp-mock running in the development setup
If the development kind cluster is running the chantico-snmp-mock service, there is a Node Port that is visible on port 31161.
It can be queried as follow:
Chantico workflow with the snmp-mock as snmp device (full demo)
For an overview of the workflow that is run in the background in this demo please see the below image.

This section demonstrates a full flow: MIB upload → MeasurementDevice → PhysicalMeasurement → Prometheus targets.
- Upload the MIB file
./dev/mibs/TNO-PDU-MIB.txtto the cluster: - Create a
MeasurementDevicefor the mock MIB: - Wait for the SNMP generator job:
- Create a
PhysicalMeasurementpointing at the mock target: - Port-forward Prometheus (if not already done by the local development
environment) and verify targets:
Open http://localhost:19090/targets and verify the target is
UP.
Adding another mock snmp device
The same mock SNMP image can be deployed multiple times to simulate additional devices. Each additional device needs its own Deployment, Service, MeasurementDevice, and PhysicalMeasurement. Example manifests for a second mock device are provided in the repository.
-
Deploy the second mock SNMP agent:
-
Create a second
MeasurementDevice(can reuse the same MIB/walks, or use different ones): -
Wait for the SNMP generator job for the new device:
-
Create a second
PhysicalMeasurementpointing at the new mock target: -
Verify both targets appear in Prometheus, port-forwarding if not already done by the local development environment:
Open http://localhost:19090/targets — both the original and the new target should show as
UP.
The second mock is exposed on NodePort 31162, so you can also query it directly:
Tip: To add more devices beyond the second, copy the mock-2 manifests, update the names (e.g.
chantico-snmp-mock-3), pick a free NodePort, and create correspondingMeasurementDevice/PhysicalMeasurementresources. Prometheus will automatically pick up new targets viafile_sd_configs— no restart required.