[Solved] Database Corruption

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

Moderators: Developers, Moderators

Post Reply
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

[Solved] Database Corruption

Post by salah »

Hello,

My Info :
System : FreeBSD 5.3-RELEASE
Cacti : Version 0.8.6h
php : PHP 4.4.2
Mysql : mysql Ver 14.7 Distrib 4.1.10a, for unknown-freebsd5.3 (i386)

I have meet a big problem on my cacti. Indeed, I think that my cacti mysql database is corrupted :

1) First, all "Associated Data Queries" except (interface statistic) disapared from my database. After looking on a orginal cacti database, I added these sql line :

Code: Select all

INSERT INTO `snmp_query` VALUES (2, '3c1b27d94ad208a0090f293deadde753', '<path_cacti>/resource/snmp_queries/net-snmp_disk.xml', 'ucd/net -  Get Monitored Partitions', 'Retrieves a list of monitored partitions/disks from a net-snmp enabled host.', 0, 2);
INSERT INTO `snmp_query` VALUES (3, '59aab7b0feddc7860002ed9303085ba5', '<path_cacti>/resource/snmp_queries/kbridge.xml', 'Karlnet - Wireless Bridge Statistics', 'Gets information about the wireless connectivity of each station from a Karlnet bridge.', 0, 2);
INSERT INTO `snmp_query` VALUES (4, 'ad06f46e22e991cb47c95c7233cfaee8', '<path_cacti>/resource/snmp_queries/netware_disk.xml', 'Netware - Get Available Volumes', 'Retrieves a list of volumes from a Netware server.', 0, 2);
INSERT INTO `snmp_query` VALUES (6, '8ffa36c1864124b38bcda2ae9bd61f46', '<path_cacti>/resource/script_queries/unix_disk.xml', 'Unix - Get Mounted Partitions', 'Queries a list of mounted partitions on a unix-based host with the', 0, 11);
INSERT INTO `snmp_query` VALUES (7, '30ec734bc0ae81a3d995be82c73f46c1', '<path_cacti>/resource/snmp_queries/netware_cpu.xml', 'Netware - Get Processor Information', 'Gets information about running processors in a Netware server', 0, 2);
INSERT INTO `snmp_query` VALUES (8, '9343eab1f4d88b0e61ffc9d020f35414', '<path_cacti>/resource/script_server/host_disk.xml', 'SNMP - Get Mounted Partitions', 'Gets a list of partitions using SNMP', 0, 12);
INSERT INTO `snmp_query` VALUES (9, '0d1ab53fe37487a5d0b9e1d3ee8c1d0d', '<path_cacti>/resource/script_server/host_cpu.xml', 'SNMP - Get Processor Information', 'Gets usage for each processor in the system using the host MIB.', 0, 12);
2) Now I can add "Associated Data Queries" for specific device :
Data Query Debug Information
+ Running data query [8].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/local/cacti/resource/script_server/host_disk.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/local/bin/php -q /usr/local/cacti/scripts/ss_host_disk.php 127.0.0.1 52 2:161:3000:AtUtKCGS:::MD5::[None] index'
+ Executing script query '/usr/local/bin/php -q /usr/local/cacti/scripts/ss_host_disk.php 127.0.0.1 52 2:161:3000:AtUtKCGS:::MD5::[None] query index'
+ Found item [hrStorageIndex='1'] index: 1
+ Found item [hrStorageIndex='2'] index: 2
+ Found item [hrStorageIndex='3'] index: 3
+ Found item [hrStorageIndex='4'] index: 4
+ Found item [hrStorageIndex='5'] index: 5
+ Found item [hrStorageIndex='6'] index: 6
+ Found item [hrStorageIndex='7'] index: 7
+ Found item [hrStorageIndex='8'] index: 8
+ Found item [hrStorageIndex='9'] index: 9
+ Found item [hrStorageIndex='10'] index: 10
+ Executing script query '/usr/local/bin/php -q /usr/local/cacti/scripts/ss_host_disk.php 127.0.0.1 52 2:161:3000:AtUtKCGS:::MD5::[None] query description'
+ Found item [hrStorageDescr='Memory Buffers'] index: 1
+ Found item [hrStorageDescr='Real Memory'] index: 2
+ Found item [hrStorageDescr='Swap Space'] index: 3
+ Found item [hrStorageDescr='Memory Buffer Clusters'] index: 4
+ Found item [hrStorageDescr='/'] index: 5
+ Found item [hrStorageDescr='/dev'] index: 6
+ Found item [hrStorageDescr='/ftp'] index: 7
+ Found item [hrStorageDescr='/tmp'] index: 8
+ Found item [hrStorageDescr='/usr'] index: 9
+ Found item [hrStorageDescr='/var'] index: 10
+ Executing script query '/usr/local/bin/php -q /usr/local/cacti/scripts/ss_host_disk.php 127.0.0.1 52 2:161:3000:AtUtKCGS:::MD5::[None] query sau'
+ Found item [hrStorageAllocationUnits='256'] index: 1
+ Found item [hrStorageAllocationUnits='4096'] index: 2
+ Found item [hrStorageAllocationUnits='4096'] index: 3
+ Found item [hrStorageAllocationUnits='1024'] index: 4
+ Found item [hrStorageAllocationUnits='2048'] index: 5
+ Found item [hrStorageAllocationUnits='512'] index: 6
+ Found item [hrStorageAllocationUnits='2048'] index: 7
+ Found item [hrStorageAllocationUnits='2048'] index: 8
+ Found item [hrStorageAllocationUnits='2048'] index: 9
+ Found item [hrStorageAllocationUnits='2048'] index: 10
+ Found data query XML file at '/usr/local/cacti/resource/script_server/host_disk.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/host_disk.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_server/host_disk.xml'

3) When i try to add a graph from this data query I get this message (graph created without name):
+ Created graph:
+ Created graph:
3) When I access the graph management menu, all graph have no name (see screenshoot)

4) All old graph work again. This problem affect only new graph.

I would like to know if I can correct this problem and how ?

Thanks A lot.
Attachments
cacti.JPG
cacti.JPG (50.68 KiB) Viewed 2532 times
Last edited by salah on Thu May 18, 2006 4:36 am, edited 1 time in total.
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Im also having the same problem..see http://forums.cacti.net/viewtopic.php?t=13240&start=15
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
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Thanks for your reply,

But the linket topic doesn't match with my problem.

Despite, when I run a check with mysql, all table seems uncorrupted :


mysqlcheck -e -u cacti cactidb
cactidb.cdef OK
cactidb.cdef_items OK
cactidb.colors OK
cactidb.data_input OK
cactidb.data_input_data OK
cactidb.data_input_fields OK
cactidb.data_local OK
cactidb.data_template OK
cactidb.data_template_data OK
cactidb.data_template_data_rra OK
cactidb.data_template_rrd OK
cactidb.graph_local OK
cactidb.graph_template_input OK
cactidb.graph_template_input_defs OK
cactidb.graph_templates OK
cactidb.graph_templates_gprint OK
cactidb.graph_templates_graph OK
cactidb.graph_templates_item OK
cactidb.graph_tree OK
cactidb.graph_tree_items OK
cactidb.host OK
cactidb.host_graph OK
cactidb.host_snmp_cache OK
cactidb.host_snmp_query OK
cactidb.host_template OK
cactidb.host_template_graph OK
cactidb.host_template_snmp_query OK
cactidb.poller OK
cactidb.poller_command OK
cactidb.poller_item OK
cactidb.poller_output OK
cactidb.poller_reindex OK
cactidb.poller_time OK
cactidb.rra OK
cactidb.rra_cf OK
cactidb.settings OK
cactidb.settings_graphs OK
cactidb.settings_tree OK
cactidb.snmp_query OK
cactidb.snmp_query_graph OK
cactidb.snmp_query_graph_rrd OK
cactidb.snmp_query_graph_rrd_sv OK
cactidb.snmp_query_graph_sv OK
cactidb.thold OK
cactidb.thold_data OK
cactidb.tholdset OK
cactidb.user_auth OK
cactidb.user_auth_perms OK
cactidb.user_auth_realm OK
cactidb.user_log OK
cactidb.version OK
any other idea ?

Thanks

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

Post by jay »

I thought that maybe you might have the same problem. Is it only new graphs that are the problem?? Do you seee your existing graphs and are they updating??

When you create a new graph if you go to graph management and click on the graph for that device. Then turn on debugging and post the output.

Also can you look in the mysql logs and see if there are any errors - e.g table corruption errors.

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
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Hello,
I thought that maybe you might have the same problem. Is it only new graphs that are the problem?? Do you seee your existing graphs and are they updating??
Yes, it's only the new graph (except snmp interface stats) that have the problem. So I'm able to see existing graph which has been uptaded.
When you create a new graph if you go to graph management and click on the graph for that device. Then turn on debugging and post the output.
If fact, If you look at my screenshoot, when I create new graph, except snmp interface stats, I can't see the name of the graph on the "graph management" output. So I can't access to the graph !

Please look at my screenshoot on my last post. Besides, you can find here the cacti log when
1) I create a new "Associated Data Queries" ( Unix - Get Mounted Partitions),
2) add graph for all unix slice (/var, /usr, ...)
3) access to the graph management menu


I have try many solution, but don't manage to solve the problem. Please help me.

Thanks

--
Salah
Attachments
cacti.zip
(4.74 KiB) Downloaded 80 times
jay
Cacti User
Posts: 390
Joined: Wed Aug 31, 2005 8:55 am
Location: Bristol, England

Post by jay »

Have you checked your graph templates to make sure there is a name and title for each graph???
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
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Yes : there is a name and a title for each graph template.

Any other idea ?

Many thanks.

--
Salah
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Hello,


I realy need your help on this problem. Some developer can help me ?


Thanks a lot

--
Salah
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I will need access to your system to be able to help. Also, please dump your database and e-mail to me:

mysqldump -u root -p cacti > cactibackup.sql

Thanks,

TheWitness

aka We can talk over the phone once you provide information..
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Hi,

Thanks for your support.

As you requested, I sent you a email with my system access information.

I'm standing by.... :-)

--
Salah
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Reviewing your template environment, it looks as though your Interface Data Query was corrupted.

As a cautionary note, when importing others templates, be careful. The way that templates are implemented in the current version of cacti, can damage other templates.

So, therefore, always do a backup of the database before importing templates. The table that can get hosed the most is the RRA definitions. So, record these.

It is also a good idea to backup your database daily, just in case you forget otherwise.

If you import the attached template, you should be back in business.

TheWintess
Attachments
cacti_data_query_snmp_interface_statistics.xml
(106.07 KiB) Downloaded 142 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Hi TheWitness,

Thanks for your support, but i the problem is not solved : I can't create a graph form the "SNMP - Get Mounted Partitions" for a Unix device.

The data query is succeffuly created, but when I add a graph for example /usr slice I get this message (ie graph created without a name !):
+ Created graph:
I have suceceffuly import your attached template, but when I try to import the template "net-snmp_disk.xml" I get this error :
Import Results

Cacti has imported the following items:
Have you a other idea ?

Thanks

--
Salah
Attachments
cacti1.JPG
cacti1.JPG (154.62 KiB) Viewed 2347 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

How late is it in spain? Have you updated PHP or MySQL lately. This is definately an issue with your distribution. When I ran on Windows using your database, I had none of these problems. So, what have you upgraded and when did it take place?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please copy the files in the current location to your installation:

http://www.cacti.net/downloads/patches/ ... re-patched

Once you do this, you may again need to re-import the template, but your problem will then be fixed.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
salah
Posts: 17
Joined: Tue Jun 28, 2005 11:42 am

Post by salah »

Hello Larry,

My problem has solved. Thanks a lot.

As you said my template was corrupted. My error is that I tried to import template form cacti's original tarball (cacti/resource) and this doesn't work. So I have export working templates from a good cacti projet and import them into my cacti corrupted project and it works !

Again, thanks a lot for your support.

--
Salah
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests