collector: support custom poll intervals

Also simplify config context schema for SNMP since we only use a single
instance.
This commit is contained in:
Timotej Lazar 2025-11-04 14:56:40 +01:00
parent be7eca3a89
commit f3eec5fcbf
4 changed files with 21 additions and 16 deletions

View file

@ -1,18 +1,19 @@
Set up metric collection with prometheus and telegraf as the SNMP proxy.
NetBox config context should contain the lists `prometheus_hosts` and `snmp_hosts` with job definitions. Each entry should define `name` and `nb_filter` user to query hosts from NetBox. For example:
Each entry in `prometheus_config` should define `name`, `hosts` and optionally `interval`. As above, `hosts` is used as a query filter.
For SNMP the properties `snmp_hosts` and optional `snmp_interval` should define respectively the NetBox query filter and poll interval.
For example:
{
"prometheus_hosts": [
"prometheus_config": [
{
"name": "classroom",
"nb_filter": "role=desktop-computer status=active location=classroom"
"hosts": "role=desktop-computer status=active location=classroom",
"interval": 300
}
],
"snmp_hosts": [
{
"name": "switch",
"nb_filter": "role=switch name__isw=sw- status=active status=staged status=planned"
}
]
"snmp_hosts": "role=switch name__isw=sw- status=active status=staged status=planned",
"snmp_interval": 300
}