Hi folks,
I have problems to assign measurement names properly when using the SNMP plugin in combination with fields and tables at the same time.
Usually, for the fields, a single metric will be generated and snmp
(plugin name) is used as measurement name. For tables, it also uses snmp
but I can assign a different measurement name using the name
config parameter like here:
[[inputs.snmp]]
...
[[inputs.snmp.field]]
oid = ".1.3.6.1.2.1.25.1.6.0"
name = "numProcesses"
[[inputs.snmp.table]]
name = "hrProcessorLoad"
[[inputs.snmp.table.field]]
oid = "HOST-RESOURCES-MIB::hrProcessorLoad"
[[inputs.snmp.table]]
oid = "HOST-RESOURCES-MIB::hrStorageTable"
name = "hrStorageTable"
I get those metrics:
snmp,agent_host=192.168.2.232,host=minion numProcesses=213i,sysUptime=807473.36 1736926680000000000
hrProcessorLoad,agent_host=192.168.2.232,host=minion influxdb_telegraf | hrStorageTable,agent_host=192.168.2.232,host=minion,hrStorageIndex=5
...
hrStorageTable,agent_host=192.168.2.232,host=minion,hrStorageIndex=6 hrStorageSize=624608i,hrStorageUsed=300333i,hrStorageAllocationFailures=0i,hrStorageType=".1.3.6.1.2.1.25.2.1.3",hrStorageDescr="Virtual Memory",hrStorageAllocationUnits=65536i 1736926680000000000
...
(I shortened the output/config a bit for readability)
That’s fine so far.
I need those unique measurement names for the table metrics because I want to filter the metrics to target separated Starlark processor plugins using namepass
filter.
Now, I want to rename the measurement snmp
to something else. The only way I have found for that is by using name_override
globally:
[[inputs.snmp]]
...
name_override = "machines"
[[inputs.snmp.field]]
oid = "RFC1213-MIB::sysUpTime.0"
[[inputs.snmp.field]]
oid = ".1.3.6.1.2.1.25.1.6.0"
[[inputs.snmp.table]]
name = "hrProcessorLoad"
[[inputs.snmp.table.field]]
oid = "HOST-RESOURCES-MIB::hrProcessorLoad"
[[inputs.snmp.table]]
oid = "HOST-RESOURCES-MIB::hrStorageTable"
name = "hrStorageTable"
But doing so does not only override the measurement name for the field metrics but also overrides the measurement names of the table metrics resulting in this:
machines,agent_host=192.168.2.232,host=minion sysUptime=807593.36,numProcesses=215i 1736926800000000000
machines,agent_host=192.168.2.232,host=minion hrProcessorLoad=13i 1736926800000000000
...
machines,agent_host=192.168.2.232,host=minion,hrStorageIndex=5 hrStorageDescr="O:\\",hrStorageAllocationUnits=0i,hrStorageSize=0i,hrStorageUsed=0i,hrStorageAllocationFailures=0i,hrStorageType=".1.3.6.1.2.1.25.2.1.4" 1736926800000000000
...
Basically, the name
parameter in the tables is ignored now. So, it is not possible anymore to distinguish different metrics in Starlark processor plugins using the namepass
parameter.
So, the question is: is it intended behavior that name_override
also overrides all the table measurement names that were explicitly set in the tables?
If yes, is there another way to assign a custom measurement name for the field metric and, at the same time, different custom measurement names for the table metrics?
Thanks alot!