Hi all,
I've got a PoC running using nautobot (source of truth, scrape with SD), prometheus and snmp-exporter. It's scaling very well, much better than we anticipated and we're very eager to put the finishing touches on the PoC.
I want to set a bunch of interfaces to either "monitored" or not. Based on that, I will generate a label. For example: "__meta_nautobot_monitored_interfaces": "Fa0,Fa1".
A full return from Nautobot might be something like:
[
{
"targets": [
"ORDER12345678"
],
"labels": {
"__meta_nautobot_status": "Active",
"__meta_nautobot_model": "Device",
"__meta_nautobot_name": "ORDER12345678",
"__meta_nautobot_id": "c301aebf-e92d-4f72-8f2b-5768144c42f4",
"__meta_nautobot_primary_ip": "xxx",
"__meta_nautobot_primary_ip4": "xxx",
"__meta_nautobot_monitored_interfaces": "Fa0,Fa1",
"__meta_nautobot_role": "CPE",
"__meta_nautobot_role_slug": "cpe",
"__meta_nautobot_device_type": "ASR9006",
"__meta_nautobot_device_type_slug": "asr9006",
"__meta_nautobot_site": "Place",
"__meta_nautobot_site_slug": "place"
}
}
]
My question is two-fold:
- I'd like to drop all unrelated interfaces. I don't know how to do that using relabeling with this comma separated string. I'm open to presenting the data in a different way, since I made the prometheus service discovery plugin myself (based on the netbox one), but I haven't thought of a better way.
- I only want to alert on the monitored interfaces. I mean, if we fix the above, this is a non-issue, but if that's not possible, I'd like to at least only alert on the monitored interfaces.
This is going to be run on ~20.000 devices with all differing configuration, models, vendor, etc. It needs to be very dynamic and all sourced from Nautobot, as well as be refreshed when changes are made there. Using snmp.yml and a generator to do so doesn't seem feasible unless I'd create a new module for every possible configuration, and that doesn't seem ideal.
If anyone has any suggestions on how to accomplish this, I'd very much appreciate it.