InfluxDB support does appear to be broken with your release,shd wrote:I also saw that many datapoints were not being pushed into db, wasn't satisfied with the speed of script and with a lack of Bosun support. So I've started to change the script. Well, it became a rewrite.
Here are my changes:Changes are not much tested, but they are working in my environment. No guarantees.0.45 (changes by simonov@gmail.com)
* Added Bosun export support (http://bosun.org/). Also OpenTSDB. May have broken InfluxDB support, haven't tested it, but should be working.
* Changed settings back to DB URI instead of db, port and so on in separate settings. Made configuration simpler.
* Fixed population of data array by key - version 0.4 was loosing too much data (for example, if there was more than one traffic_out, only one was saved)
* Converted plugin_CereusTransporter_data to a Memory table. Nice improvement in speed. Make sure to make mysql memory table parameters bigger
(tmp_table_size and max_heap_table_size). Table will be recreated automatically by the upgrade script (hopefully).
Data is considered temporary and gets deleted on every sending pass.
* Added much more additional data to metrics: host and hostname, data source type (gauge, counter), index type and value if used, units and so on.
Unit name is taken from Vertical Label of Graph Template for datasource. If there are multiple Graph Templates, only one value will be taken.
Vertical Label text should be from this list, or bosun will skip it: https://godoc.org/bosun.org/metadata#Unit
Metrics info for Bosun is sent to different api outlet.
* Pre-populated all needed info from DB. No SQL queries are made for each metric. HUGE improvement in speed. Now it takes about 90 seconds on average
to send 168k data points into Bosun.
* Additional stats in poller logs. Example:
CereusTransporter: Poller[0] STATS: Time:98.82 LookupTableSize:32685 LookupUnitsTableSize:22363 MetricsCount:168862 AverageHostTime:0.12
SlowestHostnames:[host1: 3.544s, host2: 2.784s, host3: 2.216s, host4: 2.159s]
Code: Select all
1/19/2016 02:16:02 PM - CereusTransporter: Poller[0] ERROR: https is not a valid scheme
01/19/2016 02:16:02 PM - CereusTransporter: Poller[0] DEBUG: Adding the following data to influxdb: [1453241762] []
01/19/2016 02:16:02 PM - CereusTransporter: Poller[0] DEBUG: influxdb Units lookup table size: [61]
01/19/2016 02:16:02 PM - CereusTransporter: Poller[0] DEBUG: influxdb Lookup table size: [0]
01/19/2016 02:16:02 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1054', SQL:" SELECT ds.id ,host.hostname ,host.description ,data.name_cache ,(CASE WHEN rrd.data_source_type_id=1 THEN 'gauge' WHEN rrd.data_source_type_id=2 THEN 'counter' WHEN rrd.data_source_type_id=3 THEN 'counter' WHEN rrd.data_source_type_id=4 THEN 'counter' END) AS rate ,data_template.name AS metric ,host_template.name AS host_type ,(CASE WHEN EXISTS (SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME='host' AND COLUMN_NAME='polling_time') THEN host.polling_time END) polling_time FROM data_template_data data INNER JOIN data_local ds ON ds.id=data.local_data_id INNER JOIN host ON host.id=ds.host_id INNER JOIN host_template ON host_template.id=(CASE host.host_template_id WHEN 0 THEN (SELECT id FROM host_template ORDER BY id LIMIT 1) ELSE host.host_template_id END) INNER JOIN data_template ON data_template.id=data.data_template_id INNER JOIN data_template_rrd rrd ON rrd.local_data_id=data.local_data_id WHERE data.local_data_template_data_id <> 0 AND host.disabled <> 'on' GROUP BY ds.id"
01/19/2016 02:16:02 PM - CereusTransporter: Poller[0] INFO: Adding data to influxdb