Autom8 and cacti 0.8.7i => some problem SQL Error 1064

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Autom8 and cacti 0.8.7i => some problem SQL Error 1064

Post by gandalf »

c3226026 wrote:Actually I've this : max_execution_time = 30 and max_input_time = 60, but I've same parameter on apache2/php.ini and cli/php.ini
Yeh, that's default. This is to prevent php scripts from looping your CPU away. As you will perform the initial graph creation only once, I'd leave them as is and perform the graph creation in chunks
R.
cclark42
Posts: 1
Joined: Tue Dec 18, 2012 11:39 pm

Re: Autom8 and cacti 0.8.7i => some problem SQL Error 1064

Post by cclark42 »

Hello,

After installing the latest version of Boost 5.1-1 on Cacti 0.8.8a, I noticed some errors were popping up in cacti.log while boost was flushing the database entries to rrds. At first this was seemigly at random, but then I realized it was only happening while new RRDs were being created. They cover some of the errors posted here, so I will reply to this thread instead of starting a new one.

Code: Select all

12/18/2012 08:56:40 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select field_name,field_value from host_snmp_cache where host_id= and snmp_query_id= and snmp_index=''"
12/18/2012 08:56:40 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT field_value FROM host_snmp_cache WHERE host_id= AND snmp_query_id= AND snmp_index='' AND field_name='ifHighSpeed'"
12/18/2012 08:56:40 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select field_name,field_value from host_snmp_cache where host_id= and snmp_query_id= and snmp_index=''"
12/18/2012 08:56:40 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT field_value FROM host_snmp_cache WHERE host_id= AND snmp_query_id= AND snmp_index='' AND field_name='ifHighSpeed'" 
I read through the code in the boost_rrdtool_function_create function of setup.php and noticed an undefined variable was being used in the SQL queries listed above, producing the blank values. Not really knowing what it was supposed to derived from, I decided to check out the stock poller code. They're fairly similar, and lucky for me there was a line in the stock poller code which gave a value for the undefined variable in the boost poller code. Seems as though maybe a couple of lines didn't make the copy/paste over to the boost code. :)

Here is a diff with the missing lines which applies to setup.php for boost 5.1-1. I attached as a file as well since the forum messes with the whitespace.

Code: Select all

--- setup.php.old	2012-12-18 21:09:30.758937942 -0700
+++ setup.php	2012-12-18 21:07:09.983911113 -0700
@@ -1541,6 +1541,8 @@
 			/* in case no maximum is given, use "Undef" value */
 			$data_source["rrd_maximum"] = "U";
 		} elseif (strpos($data_source["rrd_maximum"], "|query_") !== false) {
+			/* in case a query variable is given, evaluate it */
+			$data_local = db_fetch_row("SELECT * FROM data_local WHERE id=" . $local_data_id);
 			if ($data_source["rrd_maximum"] == "|query_ifSpeed|" || $data_source["rrd_maximum"] == "|query_ifHighSpeed|") {
 				$highSpeed = db_fetch_cell("SELECT field_value
 					FROM host_snmp_cache
The missing lines were causing RRDs to be created with no maximum value limit... not really a huge deal, but once it was patched I wiped my rra directory and had it re-create the rrds, the maximum values were entered correctly. It's a new install, and data I don't care about... yet... I did some searching through the forums/google and found this thread. Thought I would post the fix for at least some of the errors c3226026 was getting, and hoping this will get picked up for the next version of boost.

Other than this problem which is now fixed. The new cacti install is running great, thanks guys!!
Attachments
fix_boost_rrd_create.patch
(634 Bytes) Downloaded 201 times
r0bst3r
Posts: 9
Joined: Thu Sep 20, 2012 8:00 am

Re: Autom8 and cacti 0.8.7i => some problem SQL Error 1064

Post by r0bst3r »

Any advice on how to correct this issue with an already installed boost plugin? I'm very hesitant to un and reinstall the boost plugin in a properly operating setup.
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Autom8 and cacti 0.8.7i => some problem SQL Error 1064

Post by antras »

I've just installed boost 5.1 and have the same errors:
04/13/2015 01:06:20 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1064', SQL:"select field_name,field_value from host_snmp_cache where host_id= and snmp_query_id= and snmp_index=''"
04/13/2015 01:06:20 PM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT field_value FROM host_snmp_cache WHERE host_id= AND snmp_query_id= AND snmp_index='' AND field_name='ifHighSpeed'"

Can anybody from developers comment is it ok to use suggested patch to fix an error?
antras
Posts: 38
Joined: Mon Apr 06, 2015 7:01 am

Re: Autom8 and cacti 0.8.7i => some problem SQL Error 1064

Post by antras »

After applying cclark42's patch error has gone.
It would be good anywhat to get some response from developers.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest