HELP HELP Messed up my complete Cacti installation

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

Moderators: Developers, Moderators

Post Reply
geertn444
Posts: 44
Joined: Fri Dec 02, 2005 3:24 am

HELP HELP Messed up my complete Cacti installation

Post by geertn444 »

Hi all,

I need some advanced help recovering my Cacti installation.
I have 9000 graphs with two items: traffic_in and traffic_out. I was playing aroung with the graph template (including removing the data input field) and now all my graphs fail.

I know the cause: all my graphs miss the second parameter (see first attachement).
As you can see, i need to (manually) lookup up the corresponding traffic_out of the same interface and put this in, after that it is fixed.

However, i want to do this directly in the SQL database, because i need to fix +/- 5000 of these graphs !

so my question is: where can i find the link between the graph_id and the two input parameters ?

The system is still polling the values into the data sets, just the link between the graph and the traffic_out dataset is lost.

Please help
Attachments
2009-06-03_190720.jpg
2009-06-03_190720.jpg (159.91 KiB) Viewed 932 times
2009-06-03_190513.jpg
2009-06-03_190513.jpg (132.95 KiB) Viewed 932 times
_________________
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
geertn444
Posts: 44
Joined: Fri Dec 02, 2005 3:24 am

Post by geertn444 »

We need to find out the ID of the RRD file used in the traffic_in direction
I don't know in which table i can find the unique id of an RRD. is this the id field in the data_template_id table ?

i discovered that when i lookup an id in this table, then pick the "local_data_id" in the same row and query the table "data_template_data_rra" for this id, i get two rows: traffic_in and traffic_out contained inside this RRD.

where this is all linked to graph's remains unclear.
_________________
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

sounds like the simple solution would be to rollback to your last good weekly database backup. Don't overwrite the rrd files though.
geertn444
Posts: 44
Joined: Fri Dec 02, 2005 3:24 am

Post by geertn444 »

Can you help me how to do this ?

is there a simple "rollback" command.

I don't know if there are regular backups of the database.
_________________
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

geertn444 wrote:I don't know if there are regular backups of the database.
Those would be something you would have set up... like all good system adminstrators do.
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

If you are lucky, you just altered the template. If you fix the template, all the broken data sources should work again.
[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]
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Per Rony's comment, do a fresh install of Cacti in another location, or your desktop. Export the Data Query in question and import it to your production system.

Then, in the future, schedule a cronjob that does something like the following:

Code: Select all

#!/bin/bash
# My Backup Script
BACKUPDIR=<some_location>
NUMBER=10

# See how many backups I have
BACKUPS=`ls -1 $BACKUPDIR | wc -l | tr -d ' '`

# Backup the Database
mysqldump cacti > $BACKUPDIR/cacti_backup$$.sql

# Remove old Backups
if [ $BACKUPS -ge $NUMBER ]; then
  NUMBERTOREMOVE=`expr $BACKUPS - $NUMBER`
  FILES=`ls -altr $BACKUPDIR | head -$NUMBERTOREMOVE`
  for FILE in $FILES; do
    /bin/rm -f $FILE
  done
fi
Schedule this daily in Cron, that way you will have better restoration options. Or simply run this before you go playing around. Then getting backto a good point will be as easy as:

Code: Select all

mysql cacti < mylastbackup.sql
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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest