influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.69k stars 5.59k forks source link

SNMP: Add capability to combine multiple metrics as fields in the same measurements #808

Closed titilambert closed 8 years ago

titilambert commented 8 years ago

This is the issue (proposal) based on: https://groups.google.com/forum/#!topic/influxdb/v1PQmUE0usM

juliusloman commented 8 years ago

I'd propose following design:

Config example:

 [[inputs.snmp.table]]
    measurement = "myMeasurement1"

 [[inputs.snmp.get]]
    measurement = "myMeasurement2"

 [[inputs.snmp.get]]
    measurement = "myMeasurement2"

 [[input.snmp.bulk]
    measurement = "myMeasurement3"

 [[input.snmp.measurements]]
     name = "myMeasurement1"
     single_record = true

Some line protocol examples: Table request with measurement="interfaces" and single_record=false:

> interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCInOctets=488264518i    1457443305004647980
> interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCOutOctets=121438595i 1457443305004977059

Table request with measurement="interfaces" and single_record=true:

> interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCInOctets=488264518i,ifHCOutOctets=121438595i 1457443305004647980

Is this feasible?

titilambert commented 8 years ago

@juliusloman I think so :) I like this idea :)

@sparrc Could you explain the difference, if it exists, between

interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCInOctets=488264518i    1457443305004647980
interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCOutOctets=121438595i 1457443305004977059

and

interfaces,host=192.168.1.29,instance=eth0,unit=octets ifHCInOctets=488264518i,ifHCOutOctets=121438595i 1457443305004647980

Is it necessary to be able to get both outputs ?

sparrc commented 8 years ago

nope, that is not necessary, those are exactly the same

edit: we should prefer the latter, because that creates less network and write traffic

titilambert commented 8 years ago

@sparrc Thanks for your comment ! So the next question is: Should we create a patch inside Telegraf plugin core, to group automatically measurements with same name ? (for each input plugin ?)

sparrc commented 8 years ago

I would prefer not to because this would create much larger and more complicated buffer structures (rather than just a channel, as it is now).

Most plugins should be able to write their metrics this way. SNMP is a bit of an outlier...

Infiniverse commented 8 years ago

Is there any progress on this issue? I'm just about to start collecting SNMP data on a production system, and am wondering the best way to do it. Will this bite me?

rhinst commented 8 years ago

I'm also very interested in this ability. In fact, it will determine whether or not we're able to use influxdb at all for our application.

wilsncc commented 8 years ago

I was a little disappointed when I noticed how Telegraf laid out SNMP data like this, I doesn't seem to make all that much sense.

As with @rhinst I cannot in good faith recommend we shift from RRD/MRTG to InfluxDB/Telegraf until this is resolved.

Infiniverse commented 8 years ago

It's open source so it should be a relatively easy fix for someone who knows 'GoLang' to do. Alas, I don't yet know GoLang so I've not been able to do it (easily) myself yet.

sparrc commented 8 years ago

unfortunately it's not too easy with the current SNMP plugin, hence #1389

sparrc commented 8 years ago

this is now available in 1.0 RC 1 with the new SNMP plugin, please see here to download the latest version: https://github.com/influxdata/telegraf#linux-deb-and-rpm-packages, and the changelog for details on the new SNMP plugin.