Help Sql table error

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Help Sql table error

Post by jay »

Hi

I was just looking at some stats on my Cacti setup suddenly all graphs disappeared.

I have checked sql and i see the following error.

060427 17:36:32 [ERROR] C:\MySQL\bin\mysqld-nt: Table '.\cacti\graph_templates_graph' is marked as crashed and should be repaired


I have tried to repair all tables using mysql administrator and resarted mysql but the problem is still there.


OUtput from Cacti logs

04/27/2006 05:21:58 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select graph_tree_items.id, graph_tree_items.title, graph_tree_items.local_graph_id, graph_tree_items.rra_id, graph_tree_items.order_key, graph_templates_graph.title_cache as title_cache from (graph_tree_items,graph_local) left join graph_templates_graph on (graph_tree_items.local_graph_id=graph_templates_graph.local_graph_id and graph_tree_items.local_graph_id>0) left join host on (host.id=graph_local.host_id) left join graph_templates on (graph_templates.id=graph_local.graph_template_id) left join user_auth_perms on ((graph_templates_graph.local_graph_id=user_auth_perms.item_id and user_auth_perms.type=1 and user_auth_perms.user_id=1) OR (host.id=user_auth_perms.item_id and user_auth_perms.type=3 and user_auth_perms.user_id=1) OR (graph_templates.id=user_auth_perms.item_id and user_auth_perms.type=4 and user_auth_perms.user_id=1)) where graph_tree_items.graph_tree_id=1 and graph_local.id=graph_templates_graph.local_graph_id and graph_tree_items.order_key like '___000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' and graph_tree_items.local_graph_id>0 and ((user_auth_perms.type != 1 OR user_auth_perms.type is null) AND ((user_auth_perms.type != 3) OR (user_auth_perms.type is null)) AND ((user_auth_perms.type != 4) OR (user_auth_perms.type is null))) group by graph_tree_items.id order by graph_tree_items.order_key"



I have patches appplied.

I have just done a truncate table graph_templates_graph and it has remove an array error when trying to view the graphs but there are still no graphs.

Not sure what to do to fix this as i'm not a mysql expert.

Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Maybe try running: mysqlcheck --auto-repair --databases cacti
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Hi

I did that and it came back that all were ok. I have checked mysql admin and the table crashed error seems to have gone away. I restarted the server and can confirm that the error no longer appears in the logs in mysql administrator.

I still don't have any graphs though. What can i do to get the graphs back??? Do i need to re-install Cacti???

Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

I have dropped the table and have imported a txt file with the graph_templates_graph information from cacti.sql


CREATE TABLE graph_templates_graph (
id mediumint(8) unsigned NOT NULL auto_increment,

etc, etc

INSERT INTO graph_templates_graph VALUES (2,0,0,2,'',1,'on','|host_description| - Traffic','','',120,'',500,'',100,'',0,'','bits per

etc, etc

I restarted mysql but its still not showing any graphs.

Any ideas???

Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Assuming the table is fixed, then you have a permission issue possibly. Fire up FileMon and see if anything is getting denied.

Turn on graph debugging, what is the commandline it's using and whats the error?
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

I ran filemon and no permission issues.

When you say graph debug i assume you mean graph export messages in web events??

If so i have set debug level to medium as it seems to hang with a message saying waiting for poller 1/1 when set to anything higher.

Here is some of the output.

04/28/2006 05:31:57 PM - CACTID: Poller[0] Host[97] DS[560] SNMP: v1: 172.31.103.245, dsname: NS_Int_traffic_in, oid: .1.3.6.1.4.1.3224.9.3.1.3.1, value: 1023210886
04/28/2006 05:31:57 PM - CACTID: Poller[0] Host[123] DS[786] SNMP: v2: 192.168.151.252, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.7, value: 2618311123
04/28/2006 05:31:57 PM - CACTID: Poller[0] Host[97] DS[557] SNMP: v1: 172.31.103.245, dsname: NS_Int_traffic_in, oid: .1.3.6.1.4.1.3224.9.3.1.3.1, value: 1023210886


Is this what you are looking for??

Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Here is the logfile from Cacti. Logging set to debug - graph export - no poller debugs.
Attachments
cacti-debug_graphexport.txt
(220.25 KiB) Downloaded 221 times
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I was actually talking about Graph Management -> click on a graph -> *Turn On Graph Debug Mode. Any errors?

Then take that long command and manually enter it at the commandline. Does it work?

Seems like you're properly collecting data at least. Are the rrd files getting updated every 5 mintes?
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Ooops sorry. THats the problem there are no graphs in graph management to click on. Tis foooooooooked!!!!!! :(

The RRD files are getting updated so at least im not losing any data which is a bonus.
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

jay wrote:Ooops sorry. THats the problem there are no graphs in graph management to click on. Tis foooooooooked!!!!!! :(
What happens when you turn on graph debugging in graph management?
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

I can't run debug in graph management as it shows no devices either. The devices are all listed under the device tab. I can also see the data sources as well.

Previous Showing Rows 1 to 0 of 0 [] Next >>
Graph Title Template Name Size
No Graphs Found



What i have just done is to create a new graph and then run graph management. I get the following error.

Notice: Undefined index: 0 in C:\Apache2\htdocs\cacti\lib\rrd.php on line 700

c:/rrdtool/rrdtool.exe graph - \
--imgformat= \
--start=-86400 \
--end=-60 \
--title="azwcr-bd-1-live - Traffic - 1/1" \
--base=0 \
--height=0 \
--width=0 \
--upper-limit= \
--lower-limit= \
--vertical-label="" \
--slope-mode \
DEF:a="C\:/Apache2/htdocs/cacti/rra/azwcrbd1live_traffic_in_1748.rrd":traffic_in:AVERAGE \
DEF:b="C\:/Apache2/htdocs/cacti/rra/azwcrbd1live_traffic_in_1748.rrd":traffic_out:AVERAGE \
CDEF:cdefb=a,8,* \
CDEF:cdefg=b,8,* \
COMMENT:"CIRCUIT SPEED\: 100000000 bits per second\n" \
AREA:cdefb#FF6800:"Inbound" \
GPRINT:cdefb:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefb:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefb:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:"Total In\: 0 bytes\n" \
LINE1:cdefg#380000:"Outbound" \
GPRINT:cdefg:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefg:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefg:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:"Total Out\: 0 bytes\n" \
COMMENT:"|host_description| - BD6808/G24T3-Port 1\:1 - |query_ifAlias|\n" \
COMMENT:"Last Poll\: Mon 01 May 10\:20\:45 BST 2006\n"

RRDTool Says:



Notice: Undefined index: 0 in C:\Apache2\htdocs\cacti\lib\rrd.php on line 700

ERROR: unsupported graphics format ''



Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

I have also noticed in the graph templates that the titles in the graph template field are blank.

Can anyone assist me on this please???

Jay
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Really does sound like your cacti datebase is majorly messed up. A dev will have to comment if it's fixable or if you must start over again.
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

GRRR!!!!! I was starting to fear the worst...Do I need to contact the developers, Rax, Rony and TheWitness directly via e-mail??
Cacti Version 0.8.7e, Spine 0.8.7e, Apache 2.2.15, Mysql 5.0.88, PHP 5.2.13, RRDTool 1.2.30, NET-SNMP 5.5
Quad Core AMD Opteron Processor 2384, 2.70Ghz, 2GB RAM , 1 CPU used
Windows Server 2003 (X64), VMWARE ESX
Plugins: Aggregate 0.75

SYSTEM STATS: Time:12.5140 Method:spine Processes:2 Threads:15 Hosts:400 HostsPerProcess:200 DataSources:2909 RRDsProcessed:1384
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Dump your database with the following command:

Code: Select all

mysqldump -compatible=mysql323 cacti
And email it to me... :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests