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
HELP HELP Messed up my complete Cacti installation
Moderators: Developers, Moderators
HELP HELP Messed up my complete Cacti installation
- Attachments
-
- 2009-06-03_190720.jpg (159.91 KiB) Viewed 931 times
-
- 2009-06-03_190513.jpg (132.95 KiB) Viewed 931 times
_________________
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
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.
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
| Cacti 0.8.6i with Plugin Architecture | Plugins: Monitor, Thresholds, Wheathermap
sounds like the simple solution would be to rollback to your last good weekly database backup. Don't overwrite the rrd files though.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Those would be something you would have set up... like all good system adminstrators do.geertn444 wrote:I don't know if there are regular backups of the database.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
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]
[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]
- TheWitness
- Developer
- Posts: 17047
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
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:
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:
TheWitness
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
Code: Select all
mysql cacti < mylastbackup.sql
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?
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?
Who is online
Users browsing this forum: No registered users and 2 guests