Outbound Data Sources - lost after template import

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

Moderators: Developers, Moderators

Post Reply
pavlik
Posts: 7
Joined: Thu Sep 10, 2009 9:05 am
Location: Poland

Outbound Data Sources - lost after template import

Post by pavlik »

Hi,

Few days ago I have imported new Graph Template which has overwritten my customized version of Interface - Traffic (bits/sec). After that I have realized that on some of the graphs the Outbound Data Source is missing or it's the same as Input Data Source. All data sources seems to be intact. To correct this issue I have to check every graph and manually set the proper outbound data source again.

Is there a way to set it automagically by runnig some SQL update or at least select and display the list of the graphs which are affected by this issue?

I've attached the screenshot which gives a better overview of the problem.

Thanks in advance
Paul
Attachments
cacti.JPG
cacti.JPG (64.37 KiB) Viewed 2353 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Re-importing the original template should do. See e.g. 4th link of my sig. Else install a second cacti, export it from there and re-import
Reinhard
praxis
Posts: 23
Joined: Fri Mar 17, 2006 1:13 pm

bump

Post by praxis »

^ bump

I'm having the exact same issue and re-importing doesnt seem to help (or perhaps I'm not doing it correctly). I have thousands of graphs in this state and would really hate to have to re-create them.

Ideas?
User avatar
TheWitness
Developer
Posts: 16997
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Restore from your last backup. No backup. Likely not next time....

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
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: bump

Post by gandalf »

praxis wrote:^ bump

I'm having the exact same issue and re-importing doesnt seem to help (or perhaps I'm not doing it correctly). I have thousands of graphs in this state and would really hate to have to re-create them.

Ideas?
How do you do it, then? Click wrench next to graph and post results.
R.
praxis
Posts: 23
Joined: Fri Mar 17, 2006 1:13 pm

Post by praxis »

Most of my interface graphs seem to be using the same rra for inbound and outbound...some of the graphs are using "None" for data sources. All necessary data sources exist, but I cant manually adjust the drop down on thousands of graphs.

I have found a default "interface - traffic (bits/sec)" template - if I import it, is there a chance that it will correct the existing graphs? I guess I'll give it a try, and just re-create the lot if it doesnt work.
praxis
Posts: 23
Joined: Fri Mar 17, 2006 1:13 pm

hrmm

Post by praxis »

Bad news, the import didnt fix anything.

Good news, the import made all my graphs consistently broken.

All graphs are now using the outbound data source for each graph item field...since all data sources were created in pairs, I simply need a script that can walk all graphs of this template and decrement the inbound rra by 1 in the database...since all data sources were created in pairs, it's safe to assume that for each outbound data source x, the inbound data source is x - 1.

I would like to know however why updating a template mixes up the data sources in the graph item fields...I can reproduce this behavior fairly easily now.

I'm good with php, but suck at mysql and dont understand the cacti db structure, is there anyone that can get me started towards creating a fixit script as described above? even just a schema for the cacti db?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: hrmm

Post by BSOD2600 »

praxis wrote:Bad news, the import didnt fix anything.
How come you haven't restored from your weekly backup?
praxis wrote: even just a schema for the cacti db?
http://docs.cacti.net/manual:087:99_ref ... ase_design
praxis
Posts: 23
Joined: Fri Mar 17, 2006 1:13 pm

Post by praxis »

Thanks for the schema. A large number of these graphs have been broken for an unknown period of time (months ago when the template was changed presumably)...even if I could figure out when the Graph Field items were modified, I dont believe I have a backup that far in the past. If I did, I would still risk losing a lot of graph definitions that happened since.

Looking at my graph debug, there's only minor differences between a broken graph and a fixed one:

Code: Select all

# broke
DEF:a="/www/html/cacti-0.8.7e/rra/128/12018.rrd":traffic_in:AVERAGE \
DEF:b="/www/html/cacti-0.8.7e/rra/128/12018.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefc=b,8,* \
CDEF:cdefd=a,8,* \
LINE1:cdefa#00CF00FF:"Inbound"  \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefc:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefc#002A97FF:"Outbound"  \
GPRINT:cdefd:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefd:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefd:MAX:"Maximum\:%8.2lf %s\n" 

# fixed
DEF:a="/www/html/cacti-0.8.7e/rra/128/12018.rrd":traffic_in:AVERAGE \
DEF:b="/www/html/cacti-0.8.7e/rra/128/12018.rrd":traffic_out:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
LINE1:cdefa#00CF00FF:"Inbound"  \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#002A97FF:"Outbound"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" 
I'm still determined to fix this with a script if at all possible...I just need some clues to get started. Any ideas?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest