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

Addons for Cacti and discussion about those addons

Moderators: Moderators, Developers

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

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

#91 Post by geoffg » Thu Jan 19, 2017 7:38 pm

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:
[email protected]:/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
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#92 Post by phalek » Fri Jan 20, 2017 5:11 am

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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

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

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

#93 Post by geoffg » Sat Jan 21, 2017 2:35 am

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
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#94 Post by phalek » Mon Jan 23, 2017 1:39 am

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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

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

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

#95 Post by geoffg » Mon Jan 23, 2017 2:31 am

thanks, I'll give that a go

User avatar
phalek
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#96 Post by phalek » Tue Feb 07, 2017 4:31 am

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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

Xumet
Posts: 18
Joined: Thu Mar 16, 2006 12:02 pm

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

#97 Post by Xumet » Tue Feb 14, 2017 8:36 am

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
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#98 Post by phalek » Tue Feb 14, 2017 8:44 am

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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

Xumet
Posts: 18
Joined: Thu Mar 16, 2006 12:02 pm

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

#99 Post by Xumet » Tue Feb 14, 2017 8:45 am

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

#100 Post by geoffg » Sun Feb 19, 2017 3:25 pm

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
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#101 Post by phalek » Mon Feb 20, 2017 3:18 am

The InfluxDB URL should be in this form:

Code: Select all

influxdb://user:[email protected]: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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

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

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

#102 Post by geoffg » Mon Feb 20, 2017 3:41 am

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

#103 Post by geoffg » Mon Mar 06, 2017 5:30 pm

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

#104 Post by HzE » Thu Apr 06, 2017 4:19 am

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
Cacti Guru User
Posts: 2724
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

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

#105 Post by phalek » Thu Apr 06, 2017 4:34 am

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 : CereusTransporter | CereusReporting | nmidWebService | nmidSmokeping | nmidWeb2 |

Code: Select all

CereusServer Master:  SYSTEM STATS: Time:2.5621 Method:spine Processes:1 Threads:16 Hosts:446 HostsPerProcess:446 DataSources:14683 RRDsProcessed:7573
CereusServer Agent:   SYSTEM STATS: Time:27.4840 Method:spine Processes:1 Threads:8 Hosts:16 HostsPerProcess:16 DataSources:114576 RRDsProcessed:48061
[/size]

Post Reply