guequierre / php-weathermap-influxdb

Influxdb datasource for use with network weathermap.
Apache License 2.0
8 stars 1 forks source link

Format extension for seriesin / seriesout? #1

Open sjthespian opened 9 years ago

sjthespian commented 9 years ago

Can you give an example of what you expect for seriesin/seriesout? In looking at the code, it appears I can only specify the series name itself, not any attributes for that series.

For example, if I query the snmp_rx series from my database, I am going to get 382 results, and that from just three devices (a 48-port switch, 12-port switch, and my firewall) as I'm collecting errors, discards, and traffic for each device. If I were writing an InfluxDB select, I might do something like: SELECT * FROM snmp_rx WHERE host='cisco-switch' AND type='if_octets' AND type_instance='GigabitEthernet2_0_47', but I don't see a way to do that with your code.

Any thoughts?

guequierre commented 9 years ago

i've used something like this in the config file:

LINK node04411-node04473 TARGET influxdb:influx.bla.nl:graphite:root:root:mu-6509-1_bla_nl.snmp.if_octets-Gi7_47.rx:mu-6509-1_bla_nl.snmp.if_octets-Gi7_47.tx NODES node04411 node04473

to fetch data out of influx. Btw, i never tested it against influx 0.9 or newer

Cheers, Kees

sjthespian commented 9 years ago

Thanks for the followup! Between this and some issues I'm having getting decent graphs out of grafana, I'm starting to think I make a mistake going with InfluxDB 0.9. Since I only have a couple of days worth of data, I may just dump the whole thing and install 0.8...

That said, I think the code is going to take a bit of work for 0.9. I like the format for 0.8, so I may end up using something similar like series.host.type.type_instance, so the example above would end up as snmp_rx.cisco-switch.if_octets.GigabitEthernet2_0_47. The weathermap module would build a select statement like the one above. I'll fork your repo and dabble with this a bit when I get some time and see if I can get it working with 0.9.

guequierre commented 9 years ago

I won't upgrade to influxdb 0.9 till the next release (when they come with a migration path) and i'm waiting on the next release of grafana aswell, which should include ldap-auth. After that i will look into this again.

Regards, Kees

sjthespian commented 7 years ago

Have you had any more thoughts on this issue (or are you still even maintaining this code)? I'm looking at migrating my weathermaps from graphite to influxdb and and running into the same issue. I'm debating updating the code to allow me to just specify the select statement in the query, as with interface counters I'm ending up with some really complicate select statements with derivatives.

For example: SELECT derivative(mean("ifHCInOctets"), 1s) FROM "ifXTable" WHERE "hostname" = 'switch.example.com' AND "ifName" = 'Gi2/0/48' AND time > now() - 1m GROUP BY time(30s)