adding Consolidation Functions to existing RRDs

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
sda99
Posts: 6
Joined: Wed Nov 29, 2023 4:29 pm

adding Consolidation Functions to existing RRDs

Post by sda99 »

Hello all,

does somebody have or knows of a script, that would allow me to add new CF's to existing RRDs? One of my well used Data Profiles was created with only the AVG CF binded back in the day..
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: adding Consolidation Functions to existing RRDs

Post by TheWitness »

There are some functions in the latest Cacti lib/rrd.php that can do this. They were written by Gandalf back when he was more active (and not retired). However, they have never been tested. I brought them into the 1.0 release from the 0.9 release, but again, they've never been tested.
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?
sda99
Posts: 6
Joined: Wed Nov 29, 2023 4:29 pm

Re: adding Consolidation Functions to existing RRDs

Post by sda99 »

TheWitness wrote: Fri Dec 22, 2023 12:17 pm There are some functions in the latest Cacti lib/rrd.php that can do this. They were written by Gandalf back when he was more active (and not retired). However, they have never been tested. I brought them into the 1.0 release from the 0.9 release, but again, they've never been tested.
thank you TheWitness I will try to look into it.. funny enough I found the same question in a 2009 forum post about34251.html where you also hinted at a possible perl script - sadly you haven't linked it back then, you probably don't remember anymore haha
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: adding Consolidation Functions to existing RRDs

Post by TheWitness »

If it's more than a few days, then yes. This looks like the function: rrd_copy_rra. You have to load the dom using another function, and then figure out what to pass as the third parameter. This function though looks like it's taking an array of files and making changes. rrd_rra_clone. Some starters. Use 'test data' though. If you fiddle with it and find adding some more documentation is good. Do that in the develop branch inside the function documentation as pull requests. Thanks!
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?
sda99
Posts: 6
Joined: Wed Nov 29, 2023 4:29 pm

Re: adding Consolidation Functions to existing RRDs

Post by sda99 »

TheWitness wrote: Fri Dec 22, 2023 2:12 pm If it's more than a few days, then yes. This looks like the function: rrd_copy_rra. You have to load the dom using another function, and then figure out what to pass as the third parameter. This function though looks like it's taking an array of files and making changes. rrd_rra_clone. Some starters. Use 'test data' though. If you fiddle with it and find adding some more documentation is good. Do that in the develop branch inside the function documentation as pull requests. Thanks!
thank you very much, let me just say I have a lot more reading to do ._.
sda99
Posts: 6
Joined: Wed Nov 29, 2023 4:29 pm

Re: adding Consolidation Functions to existing RRDs

Post by sda99 »

TheWitness wrote: Fri Dec 22, 2023 2:12 pm If it's more than a few days, then yes. This looks like the function: rrd_copy_rra. You have to load the dom using another function, and then figure out what to pass as the third parameter. This function though looks like it's taking an array of files and making changes. rrd_rra_clone. Some starters. Use 'test data' though. If you fiddle with it and find adding some more documentation is good. Do that in the develop branch inside the function documentation as pull requests. Thanks!
OK, I am also thinking about a different approach.. would it be possible to: backup all my current RRDs, then delete them from the default location - this would force all the RRDs to be recreated on the next poll (if my data source templates are at this point already mapped to the new Data Profile Preset - would the new RRDs be recreated with those new RRAs+CFs?), meaning all my graphs start flushed again; however could I then somehow use the backup RRDs in the same Cacti instance to only view my historic graphs somehow?
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: adding Consolidation Functions to existing RRDs

Post by Osiris »

You can do that, and then create a script to splice_rrd.php the resulting files. I think it should work.
Before history, there was a paradise, now dust.
sda99
Posts: 6
Joined: Wed Nov 29, 2023 4:29 pm

Re: adding Consolidation Functions to existing RRDs

Post by sda99 »

Osiris wrote: Sat Dec 23, 2023 10:30 am You can do that, and then create a script to splice_rrd.php the resulting files. I think it should work.
oh so I could actually use splice to merge RRDs even with different RRA/CF structures?
User avatar
Osiris
Cacti Guru User
Posts: 1424
Joined: Mon Jan 05, 2015 10:10 am

Re: adding Consolidation Functions to existing RRDs

Post by Osiris »

As long as the final is correct, yes. I think both additive and subtractive should work.
Before history, there was a paradise, now dust.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests