Patch: "Structured RRD Path"
Moderators: Developers, Moderators
- browniebraun
- Developer
- Posts: 791
- Joined: Tue Jun 13, 2006 1:17 am
- Location: Cologne, Germany
Patch: "Structured RRD Path"
Hi CACTI community!
One disadvantage of the Cacti file structure is the flat file directory RRA, especially in great enviroments. For example we have 30.000 rrd's in one folder.
To overcome this, we decided to structure the directory in host_id/local_data_id.
A second issue was the naming of the rrd's with devicename_data_source_local_data_id when a hostname changed. The only needed identifier is the local_data_id. For human readability we plan a script to reverse lookup local_data_id to devicename.
Old structure of RRA folder:
/RRA/
......../labrt01_traffic_in_194.rrd
New structure of RRA folder:
/RRA/
..../$host_id/
................../$local_data_id.rrd
The patch is designed to give you the chance to switch between the old, flat file organization and a structured form with subfolders.
The screenshot displays the modified path setting checkbox.
The script (extended_RRA.php) make it possible to migrate a existing Cacti installation with all rrd files and database entries.
It's designed to run only from command line.
It's my first shot with PHP, so please be patient with me, and give me as much feedback as you can.
Please notice:
USE THIS PATCH AT YOUR OWN RISK and
PLEASE
READ THE README.TXT BEFORE
Best regards
BrownieBraun
One disadvantage of the Cacti file structure is the flat file directory RRA, especially in great enviroments. For example we have 30.000 rrd's in one folder.
To overcome this, we decided to structure the directory in host_id/local_data_id.
A second issue was the naming of the rrd's with devicename_data_source_local_data_id when a hostname changed. The only needed identifier is the local_data_id. For human readability we plan a script to reverse lookup local_data_id to devicename.
Old structure of RRA folder:
/RRA/
......../labrt01_traffic_in_194.rrd
New structure of RRA folder:
/RRA/
..../$host_id/
................../$local_data_id.rrd
The patch is designed to give you the chance to switch between the old, flat file organization and a structured form with subfolders.
The screenshot displays the modified path setting checkbox.
The script (extended_RRA.php) make it possible to migrate a existing Cacti installation with all rrd files and database entries.
It's designed to run only from command line.
It's my first shot with PHP, so please be patient with me, and give me as much feedback as you can.
Please notice:
USE THIS PATCH AT YOUR OWN RISK and
PLEASE
READ THE README.TXT BEFORE
Best regards
BrownieBraun
- Attachments
-
- Modified setting entry
- cacti.PNG (46.83 KiB) Viewed 26680 times
-
- extended_RRA.tar
- Patch, script and readme
- (20 KiB) Downloaded 807 times
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Um...
[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: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
We had planned to forstall this feature till 0.9. But it's been on the request list for it seams like decades. Maybe we should do something about it.
TheWitness
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Oh, BTB, this is a core function, therefore, I would have difficulty supporting this unless it was a part of the "base" product. It is one clear feature that could make it difficult to support future upgrades for those who choose to implement it.
So, if you are reading this, implement at your own risk. I would hold off for a bit.
TheWitness
So, if you are reading this, implement at your own risk. I would hold off for a bit.
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?
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?
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Not decades , but I've submitted a bug nearly 2 years ago : http://bugs.cacti.net/view.php?id=284TheWitness wrote:We had planned to forstall this feature till 0.9. But it's been on the request list for it seams like decades. Maybe we should do something about it.
Believe me or not, I've changed <path_rra> for all of my ~ 10k data sources by hand...
And I still love Cacti !
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
- browniebraun
- Developer
- Posts: 791
- Joined: Tue Jun 13, 2006 1:17 am
- Location: Cologne, Germany
Hi there,
Recently bumped into this post. Great and awesome feature. I needed it too. It works with me, BUT I am always very picky. Is it possible to have the name of the host instead of the host ID in the path ../name/graph_xxx.rrd?
Structured RRA increments host id numbers for every added host. After adding more than dozen hosts you will forget which folder is which.
Eugene
Recently bumped into this post. Great and awesome feature. I needed it too. It works with me, BUT I am always very picky. Is it possible to have the name of the host instead of the host ID in the path ../name/graph_xxx.rrd?
Structured RRA increments host id numbers for every added host. After adding more than dozen hosts you will forget which folder is which.
Eugene
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
When we roll this into production, we will offer a drop down that let's you pick your method. Then, all hosts/graphs created after that point will be locked in. If you change in the middle though I do not propose modifying RRA file names from the user interface.
Ian has been against doing these types of things from the web interface due to security issues. Aka, read access is ok from the web site, but write is not.
This is one of the reasons we came up with the poller_commands table. It's intention is to perform various tasks after the poller has completed.
Regards,
TheWitness
Ian has been against doing these types of things from the web interface due to security issues. Aka, read access is ok from the web site, but write is not.
This is one of the reasons we came up with the poller_commands table. It's intention is to perform various tasks after the poller has completed.
Regards,
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?
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?
- browniebraun
- Developer
- Posts: 791
- Joined: Tue Jun 13, 2006 1:17 am
- Location: Cologne, Germany
Hi CACTI community!
Last days I preferred to keep silent and to watch the trend of this discussion.
In my opinion it would be great to integrate a function in install.php,
so you can make a decision which RRD structure you want to use after you have installed cacti.
I agree with TheWitness's idea to lock it after you have picked your method. As you can
read it in the readme file I can not provide a mixed structure.
Using the poller_commands table would close the little security issue i have opened with this patch.
zheka: Please notice. In a great enviroment it's possible to have routers with the same name but different domains.
So if you change the name of the folder from $host_id to its name, you will lose the singleness which is needed.
The name of a router must not be forever. So what would you do if its name has been changed?
By using this structure ($host_id\local_data_id) in cacti you will only have to edit the description of the device under
"devices". Thats all!
A reverse lookup would be much more better in this case.
Here i'll see an synergy with "rrdcleaner" plugin.
Best regards
BrownieBraun
Last days I preferred to keep silent and to watch the trend of this discussion.
In my opinion it would be great to integrate a function in install.php,
so you can make a decision which RRD structure you want to use after you have installed cacti.
I agree with TheWitness's idea to lock it after you have picked your method. As you can
read it in the readme file I can not provide a mixed structure.
Using the poller_commands table would close the little security issue i have opened with this patch.
zheka: Please notice. In a great enviroment it's possible to have routers with the same name but different domains.
So if you change the name of the folder from $host_id to its name, you will lose the singleness which is needed.
The name of a router must not be forever. So what would you do if its name has been changed?
By using this structure ($host_id\local_data_id) in cacti you will only have to edit the description of the device under
"devices". Thats all!
A reverse lookup would be much more better in this case.
Here i'll see an synergy with "rrdcleaner" plugin.
Best regards
BrownieBraun
Inclusion of this patch in 0.86i?
This is functional, and makes the device:file naming MUCH more elegant to work with behind the scenes (calling rrdtool from other apps). Is there any intent to include this work in Cacti? Is there any reason not to? IMO, this makes more sense than naming the RRD after sysName, and (potentially) having to change it. The ID can be pulled from the database easily, and will always* match the filename.
I for one definitely would like to see this in the next production release.
/eli
I for one definitely would like to see this in the next production release.
/eli
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Re: Inclusion of this patch in 0.86i?
One issue, who says the device is SNMP enabled, or even has sysName set.estair wrote:This is functional, and makes the device:file naming MUCH more elegant to work with behind the scenes (calling rrdtool from other apps). Is there any intent to include this work in Cacti? Is there any reason not to? IMO, this makes more sense than naming the RRD after sysName, and (potentially) having to change it. The ID can be pulled from the database easily, and will always* match the filename.
I for one definitely would like to see this in the next production release.
/eli
[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]
Terminology correction :)
I considered clarifying, but was too distracted... so thanks
I don't necessarily mean "SNMP sysName", moreso that the host->description in the database itself is less valid as a unique identifier than the 'id' row.
/eli
I don't necessarily mean "SNMP sysName", moreso that the host->description in the database itself is less valid as a unique identifier than the 'id' row.
/eli
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
id is the only unique name that doesn't change with user input.
So, that being said, it will probably be used as the host directory name.
So, that being said, it will probably be used as the host directory name.
[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]
Who is online
Users browsing this forum: No registered users and 0 guests