InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Updated!

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

Post Reply
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

Hi

I am struggling with this because I am not a coder.
So far, I have got the plugin installed, and I can see data being written to the MySQL db table for the plugin.

I have influxdb installed, and created a db called "influx" (because I am boring). I have not set up any authentication or anything, and I have the plugin set up to http://localhost:8086/influx as per instructions. However, when it writes to the influxDB i get this error:

01/20/2017 01:30:40 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 ,host.polling_time as 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/20/2017 01:30:39 PM - CereusTransporter: Poller[0] INFO: Adding data to influxdb

This error has been posted before but nothing suggested has worked for me.

For the record:
root@watchdog:/usr/share/cacti/site/plugins/CereusTransporter# influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 1.1.1
InfluxDB shell version: 1.1.1
> create database influx
> use influx
Using database influx
>

I'd really appreciate some help if possible
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

go to your mysql comannd interface and execute the sql statement:

Code: Select all

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 ,host.polling_time as 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
It should provide a bit more information on what is wrong here.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

I had tried this before with no additional info, but this time i got:
#1054 - Unknown column 'host.polling_time' in 'field list'
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

This is fixed on 0.8.8, if you're using anything earlier, you will execute the following on your DB:

Code: Select all

alter table host ADD COLUMN polling_time decimal(10,5) NOT NULL DEFAULT '0.00000' AFTER `avg_time`;
Look here for details: http://bugs.cacti.net/bug_view_page.php?bug_id=1550
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

thanks, I'll give that a go
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

Updated to 0.65 with Cacti 1.0 support. Please test it.

https://www.urban-software.com/products ... ansporter/
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Xumet
Posts: 18
Joined: Thu Mar 16, 2006 12:02 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by Xumet »

Where can I donwload 0.64 version? I've Cacti 0.8.8h and the latest version doesn't works.

Thanks
X.
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

Go here:

https://www.urban-software.com/products ... ansporter/

I've added the link to the 0.64 there.
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Xumet
Posts: 18
Joined: Thu Mar 16, 2006 12:02 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by Xumet »

phalek wrote:Go here:

https://www.urban-software.com/products ... ansporter/

I've added the link to the 0.64 there.
Thanks!!!!
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

Hi

since updating to .65 I am getting this error:

2017-02-20 09:20:02 - ERROR PHP NOTICE in Plugin 'CereusTransporter': Undefined index: pass in file: /usr/share/cacti/site/plugins/CereusTransporter/vendor/influxdb/influxdb-php/src/InfluxDB/Client.php on line: 277
2017-02-20 09:20:02 - CMDPHP PHP ERROR NOTICE Backtrace: (/poller.php: 717 api_plugin_hook)(/lib/plugins.php: 68 api_plugin_run_plugin_hook)(/lib/plugins.php: 161 CereusTransporter_poller_bottom)(/plugins/CereusTransporter/setup.php: 292 CereusTransporter_send_data)(/plugins/CereusTransporter/setup.php: 83 CereusTransporter_influxdb_send_data)(/plugins/CereusTransporter/includes/influxdb.php: 27 fromDSN)(/plugins/CereusTransporter/vendor/influxdb/influxdb-php/src/InfluxDB/Client.php: 277 CactiErrorHandler)(/lib/functions.php: 4242 cacti_debug_backtrace)

I am using cacti 1.03 and php 7.1
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

The InfluxDB URL should be in this form:

Code: Select all

influxdb://user:pass@host:port/dbname
Can you check what you did set in the settings page ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

Is that a new requirement for this version? I didnt have to do that previously, as far as I remember.

Seems to have resolved it as I now get:

Code: Select all

PHP Notice:  Undefined index: index_type in /usr/share/cacti/site/plugins/CereusTransporter/setup.php on line 179
this is my poller error log - its full of it. I know its only a notice, but I thought I would bring it to your attention
geoffg
Posts: 32
Joined: Sun Jun 30, 2013 11:03 pm

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by geoffg »

Hi Phalek

I have got a number of graphs now working, but I am finding there is a number of them which are not being populated from cacti.

For example, I have a number of MSSQL graphs which have data in cacti, but do not appear in influx at all. That is, when I query the influx db, I get results from the host, but none for these graphs, for example "Z-DB" is an MSSQL server for which I use the MSSQL template and have mssql cacti graphs for, but this is all there is in influx:

Code: Select all

> SELECT * FROM /.*/ WHERE "host" = '192.168.2.1' limit 1
name: host.mib.cpu.utilization
time                cacti_data_id collector description host        host_type            hostname    index_type index_value metric_text                namecache                         polling_time rate  type units   value
----                ------------- --------- ----------- ----        ---------            --------    ---------- ----------- -----------                ---------                         ------------ ----  ---- -----   -----
1487532013000000000 1061          cacti     Z-Aquira    192.168.2.1 Windows 2000/XP Host 192.168.2.1                        Host MIB - CPU Utilization Z-Aquira - CPU Utilization - CPU0              gauge cpu  percent 3

name: host.mib.hard.drive.space
time                cacti_data_id collector description host        host_type            hostname    index_type index_value metric_text                 namecache                  polling_time rate  type      units value
----                ------------- --------- ----------- ----        ---------            --------    ---------- ----------- -----------                 ---------                  ------------ ----  ----      ----- -----
1487532013000000000 1056          cacti     Z-Aquira    192.168.2.1 Windows 2000/XP Host 192.168.2.1                        Host MIB - Hard Drive Space Z-Aquira - Used Space - A:              gauge hdd_total bytes 0

name: host.mib.logged.in.users
time                cacti_data_id collector description host        host_type            hostname    index_type index_value metric_text                namecache                  polling_time rate  type  units value
----                ------------- --------- ----------- ----        ---------            --------    ---------- ----------- -----------                ---------                  ------------ ----  ----  ----- -----
1487305806000000000 1054          cacti     Z-Aquira    192.168.2.1 Windows 2000/XP Host 192.168.2.1                        Host MIB - Logged in Users Z-Aquira - Logged in Users              gauge users users 6

name: host.mib.processes
time                cacti_data_id collector description host        host_type            hostname    index_type index_value metric_text          namecache            polling_time rate  type units     value
----                ------------- --------- ----------- ----        ---------            --------    ---------- ----------- -----------          ---------            ------------ ----  ---- -----     -----
1487305806000000000 1055          cacti     Z-Aquira    192.168.2.1 Windows 2000/XP Host 192.168.2.1                        Host MIB - Processes Z-Aquira - Processes              gauge proc processes 59

name: interface.errors.discards
time                cacti_data_id collector description host        host_type            hostname    index_type index_value metric_text                 namecache                                     polling_time rate    type        units      value
----                ------------- --------- ----------- ----        ---------            --------    ---------- ----------- -----------                 ---------                                     ------------ ----    ----        -----      -----
1487305806000000000 1063          cacti     Z-Aquira    192.168.2.1 Windows 2000/XP Host 192.168.2.1                        Interface - Errors/Discards Z-Aquira - Errors - 192.168.2.1 - ethernet_10              counter discards_in errors/sec 0

dont know if this error from the log helps:

Code: Select all

2017-03-07 12:12:32 - CereusTransporter STATS: Time:7.73 LookupTableSize:2609 LookupUnitsTableSize:2576 MetricsCount:6391 AverageHostTime:0.14 SlowestHostnames:[192.168.2.43: 0.529s, 192.168.2.44: 0.421s, 192.168.2.33: 0.369s, 192.168.2.40: 0.340s]
2017-03-07 12:12:32 - CereusTransporter Finished adding [382] of data points for [192.168.2.40]
[url] http://localhost:8086/write?db=cacti&precision=s
[reason phrase] Bad Request
[status code] 400
2017-03-07 12:12:32 - CereusTransporter ERROR: Writing has failed, exception: Client error response
2017-03-07 12:12:31 - CereusTransporter DEBUG: Adding [382] of data points for [192.168.2.40]
HzE
Posts: 20
Joined: Wed Oct 27, 2010 5:40 am
Location: Espoo, Finland
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by HzE »

Seems to be working quite fine for me after the upgrade (after I got around the problem of no user/pass not being provided).

However I'm also seeing these in the logs:

Code: Select all

2017-04-06 11:36:18 - CMDPHP PHP ERROR NOTICE Backtrace: (/poller.php: 717 api_plugin_hook)(/lib/plugins.php: 68 api_plugin_run_plugin_hook)(/lib/plugins.php: 161 CereusTransporter_poller_bottom)(/plugins/CereusTransporter/setup.php: 179 CactiErrorHandler)(/lib/functions.php: 4295 cacti_debug_backtrace)
2017-04-06 11:36:18 - ERROR PHP NOTICE in Plugin 'CereusTransporter': Undefined index: index_type in file: /usr/share/cacti-1.1.2/plugins/CereusTransporter/setup.php on line: 179 
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Re: InfluxDB/Grafana/Bosun + Cacti = CereusTransport - Upda

Post by phalek »

Thanks for reporting. Please try 0.66: https://www.urban-software.com/products ... ansporter/
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests