0
votes

new to Influxdb but liking it a lot I've configured it gather metrics from snmp polled devices - primarily network nodes I can happily graph the statistics polled using derived values but what I want to know Is it possible to create a new measurement in influxdb from data already stored? The use case is we poll network traffic and graph it by doing the derived difference between the current and last reading (grafana) What I want to do is create a measurement that does that in the influxdb and stores it. This is primarily so I can setup monitoring of the new derived value using a simple query and alert if it drops below x.

I have a measurement snmp_rx / snmp_tx with host and port name with the polled ifHCInOctets and ifHCOutOctets so can I do a process that continuously creates a new measurement for each showing the difference between current and last readings? Thanks

1
Can you outline what your schema looks like in line protocol a bit. I think what you want to do is possible, but its hard to tell without a bit more information.Michael Desa
Hi Actually I managed to solve the issue tangentially using a nagios plugin to alert difference between values but for info here is the values from my influxdb > select * from snmp_rx where host='labswitch1' AND type='if_octets' and type_instance='GigabitEthernet0_1.1121' limit 3 name: snmp_rx ------------- time host type type_instance value 1467938258446212000 labswitch1 if_octets GigabitEthernet0_1.1121 1.432378803e+09 1467938318446534000 labswitch1 if_octets GigabitEthernet0_1.1121 1.432380223e+09Jason

1 Answers

0
votes

Apparently influxdb feature you are looking for is called continuous queries :

A CQ is an InfluxQL query that the system runs automatically and periodically within a database. InfluxDB stores the results of the CQ in a specified measurement

It will allow you to automatically create and fill new octet rates measurements from raw ifHCInOctet/ifHCOutOctets counters you have using derivative function in select statement and configured group by time interval. You can also do some scaling in select expression (like bytes-to-bits, etc).