Bulk rename of Datasources

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

Moderators: Developers, Moderators

Post Reply
LtTentacle
Posts: 6
Joined: Mon Nov 28, 2005 2:34 pm

Bulk rename of Datasources

Post by LtTentacle »

Hopefully someone has run across this becasue it's getting me quite stumped, and I can't find anything anywhere to help me out.

I've got about 1200 data sources that when they were created we named in the format of:

|host_description| - Traffic - |query_suRemarks|

However, due to some changes in what we want to do with cacti I need to rename these data sources in the format of:

|host_description| - Traffic - |query_suRemarks| - Mac - |query_suMac|

I have changed the naming method in the host template etc so any new data sources are named in this style, but I'm wondering if anyone has had any luck with changing the existing names of data sources to a new templated method, or if I'll be stuck changing the name of 1000+ datasources manually.

Thanks
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Two possible methods, neither which I've researched ;-)

1) there might be a script already with cacti that will reapply suggested graph titles (which is what you can manually do to fix them).

2) Write an SQL query to manually update all the graph titles.
LtTentacle
Posts: 6
Joined: Mon Nov 28, 2005 2:34 pm

Post by LtTentacle »

Yeah... unfortunately I've been sorta down those roads without a lot of luck. I can't seem to find the right table in the SQL db to make any changes. I've used the built in rename function to get all the graphs renamed properly, but I'm hitting a wall with getting the datasources to rename as I can't seem to find a function that mirrors the graph rename function.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You know, I did it for graphs, but never thought of doing for Data Sources. Please open a feature request at http://bugs.cacti.net. It's not too difficult to write. Either way, I will not change your file names.

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?
LtTentacle
Posts: 6
Joined: Mon Nov 28, 2005 2:34 pm

Post by LtTentacle »

Thanks, I've opened a feature request (http://bugs.cacti.net/view.php?id=1082).
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests