|
|
| Author |
Message |
mpdsville1 Cacti User
Joined: 16 Mar 2005 Posts: 50 Location: Albany , NY , USA
|
Posted: Mon Jun 27, 2005 3:03 pm Post subject: Thold, using autocreate threshold.. SQL Error |
|
|
I suspect i'm looking for a row (or more) on a table with
an incorrectly empty field, but i could use a nudge in the
direction of which table I should be looking closely at ..
I have a few select hostids that this happens for ..
http://www.xxx.yyy.zzz/cacti/thold.php?action=autocreate&hostid=47
Created threshold for data_id 738 and rrd_id 1680
Created threshold for data_id 711 and rrd_id 1610
Created threshold for data_id 711 and rrd_id 1609
Created threshold for data_id 712 and rrd_id 1612
Created threshold for data_id 712 and rrd_id 1611
Created threshold for data_id 713 and rrd_id 1614
Created threshold for data_id 713 and rrd_id 1613
Created threshold for data_id 714 and rrd_id 1616
Created threshold for data_id 714 and rrd_id 1615
Created threshold for data_id 715 and rrd_id 1618
Created threshold for data_id 715 and rrd_id 1617
Created threshold for data_id 716 and rrd_id 1620
Created threshold for data_id 716 and rrd_id 1619
Created threshold for data_id 717 and rrd_id 1622
Created threshold for data_id 717 and rrd_id 1621
Created threshold for data_id 718 and rrd_id 1624
Created threshold for data_id 718 and rrd_id 1623
Created threshold for data_id 719 and rrd_id 1626
Created threshold for data_id 719 and rrd_id 1625
Created threshold for data_id 720 and rrd_id 1628
Created threshold for data_id 720 and rrd_id 1627
Created threshold for data_id 721 and rrd_id 1632
Created threshold for data_id 721 and rrd_id 1631
Created threshold for data_id 721 and rrd_id 1630
Created threshold for data_id 721 and rrd_id 1629
Created threshold for data_id 722 and rrd_id 1636
Created threshold for data_id 722 and rrd_id 1635
Created threshold for data_id 722 and rrd_id 1634
Created threshold for data_id 722 and rrd_id 1633
Created threshold for data_id 723 and rrd_id 1640
Created threshold for data_id 723 and rrd_id 1639
Created threshold for data_id 723 and rrd_id 1638
Created threshold for data_id 723 and rrd_id 1637
Update failed:
INSERT INTO thold (element, rra) VALUES (, 724)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 724)' at line 1
Thanks ! |
|
| Back to top |
|
 |
cigamit Developer
Joined: 07 Apr 2005 Posts: 978 Location: B/CS Texas
|
Posted: Mon Jun 27, 2005 3:52 pm Post subject: |
|
|
You can try this (sorry no real patch since my thresholds functions are highly customized and the patch would work on yours)
Open
lib/thold-functions.php
Find this
| Code: | | $rrdsql = mysql_fetch_array(mysql_query("SELECT id FROM data_template_rrd WHERE local_data_id=$local_data_id LIMIT 1")); |
and replace it with
| Code: | $rrdsql = mysql_fetch_array(mysql_query("SELECT id FROM data_template_rrd WHERE local_data_id=$local_data_id order by id LIMIT 1"));
|
and let me know how that works for you. This was a pain to debug and find awhile back, but it has worked perfectly for me since. |
|
| Back to top |
|
 |
zardoz
Joined: 03 Jun 2005 Posts: 3
|
Posted: Tue Jun 28, 2005 4:35 am Post subject: |
|
|
| I have seen this problem when my data sources did not match up with my graphs... The way round it was to delete and recreate the appropriate bits. |
|
| Back to top |
|
 |
mpdsville1 Cacti User
Joined: 16 Mar 2005 Posts: 50 Location: Albany , NY , USA
|
Posted: Tue Jun 28, 2005 8:33 am Post subject: |
|
|
@ Cigamit
No Joy .. Script tanks sooner though ..
@ zardoz
recall specific table / field I'm looking for to examine with mysql for null
element #? Are you saying delete the device and associated datasources
for same and recreate it all? If i pick on a specific device,{hostid=47 in
this case} All my graphs are intact and updating.. Examining the
data_template_rrd table reveals no nulls in the id or local_data_id
columns..
Thanks Loads .. |
|
| Back to top |
|
 |
memic
Joined: 12 Jul 2005 Posts: 5
|
Posted: Tue Jul 12, 2005 8:50 am Post subject: thlod auto creation |
|
|
I have the same error with some hosts and the problem seems to be that
this query returns an empty result and the next result fails cause of that.
$rrdsql = mysql_fetch_array(mysql_query("SELECT id FROM data_template_rrd WHERE local_data_id=$local_data_id order by id LIMIT 1")); |
|
| Back to top |
|
 |
memic
Joined: 12 Jul 2005 Posts: 5
|
Posted: Tue Jul 12, 2005 9:06 am Post subject: funny thing |
|
|
| is after deleting the host and recreating it the error was gone. |
|
| Back to top |
|
 |
pipemajor
Joined: 02 Mar 2006 Posts: 4
|
Posted: Tue Mar 14, 2006 3:20 am Post subject: not with me |
|
|
Hej
i have the same problem im using cacti 0.8.6h and thold 0.2.7
i got the same message and when i deleted the host and created it again i have the same error message! |
|
| Back to top |
|
 |
torstentfk Cacti User
Joined: 05 Apr 2005 Posts: 182 Location: Munich, Germany
|
Posted: Fri Apr 07, 2006 6:59 am Post subject: |
|
|
Hi,
I had the same problem here.
I searched a little time at my data sources and noticed 3 ds of the same interface with only ONE linked to a graph.
I deleted all ds and the graph, recreated the graph an now the auto-thold works fine.
Torsten |
|
| Back to top |
|
 |
|