maxwo/snmp_notifier

Template for ID, similar as for Description

WrzocHoo opened this issue · 1 comments

As for version 1.0.0 Description varbind is configurable via template, however ID is hardcoded.

It would be good to have templating mechanism for ID field too, with some way to filter out unwanted messages by setting it to empty for example and do not send trap in such case. This will make this tool much more flexible and powerful.

An example use cases:

  • remapping known OIDs to some more meaningful/nicer/shorter name. If I use only default OID, then putting it in ID field is not needed at all and I will be able to skip it
  • get rid of known garbage (if I group only on alertname on AlertManager, then "[alertname=" and "]" are also garbage.
  • filtering out OIDs which are not on white list
  • filtering out OIDs which are on blacklist

Event with basic comparison and regex it would be powerful.

maxwo commented

Hi,
This is indeed a nice idea, and was willing to do this. It was actually implemented in the very first versions.
But I came to remove this feature, as it would never come close to the grouping/relabelling/routing features of Prometheus and Alertmanager, which come bundled with all the features you mention.
The default ID is, as its name says, just an ID. It could have been a hash or UUID or something like that, as long as it is deterministic, to close opened traps. The current format makes it comprehensible though.
Therefore, the idea is to make all grouping/filtering on the Alertmanager side, and the SNMP gateway will just receive alerts and send traps, while ensuring there is no ID collision.