Thold, using autocreate threshold.. SQL Error
Moderators: Developers, Moderators
- mpdsville1
- Cacti User
- Posts: 71
- Joined: Wed Mar 16, 2005 12:11 pm
- Location: Albany , NY , USA
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? ... &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 !
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? ... &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 !
Mike Donnelly , Albany , NY
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
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
and replace it with
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.
Open
lib/thold-functions.php
Find this
Code: Select all
$rrdsql = mysql_fetch_array(mysql_query("SELECT id FROM data_template_rrd WHERE local_data_id=$local_data_id LIMIT 1"));
Code: Select all
$rrdsql = mysql_fetch_array(mysql_query("SELECT id FROM data_template_rrd WHERE local_data_id=$local_data_id order by id LIMIT 1"));
- mpdsville1
- Cacti User
- Posts: 71
- Joined: Wed Mar 16, 2005 12:11 pm
- Location: Albany , NY , USA
@ 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 ..
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 ..
Mike Donnelly , Albany , NY
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
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"));
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"));
funny thing
is after deleting the host and recreating it the error was gone.
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!
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!
-
- Cacti User
- Posts: 367
- Joined: Tue Apr 05, 2005 9:52 am
- Location: Munich, Germany
Who is online
Users browsing this forum: No registered users and 0 guests