Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Tue Sep 16, 2014 10:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Avoiding duplicated RRD files
PostPosted: Thu Mar 20, 2008 12:44 pm 
Offline

Joined: Thu Mar 20, 2008 12:30 pm
Posts: 22
I've set up a new script that's pulling some data over SSH. It has about 25 output values. I created a data import method, etc etc for that. Then I created a data template and included a bunch of items it it -- say item_1 through item_9.

Then I created a graph template and a graph for it. These only use item_1 through item_5.

The resulting RRD file contains item_1 through item_9. That's fine -- I want item_6, item_7, item_8, item_9 on another graph. I create another graph template and add those items.

But now Cacti makes two RRD files with the same data, instead of pulling the data for both graphs from one RRD file. This is going to use up way too much disk space.

How do I solve this problem? What's the "right way" to do this?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 9:08 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Define only those data sources in a Data Template, that are required for a single graph. You will avoid duplicating data but pay with multiple ssh calls, then.
If you do not like this approach, define ALL data sources within one template. But create only the first graph as usual (this one will cause the polling to occur and fill up the rrd file). All subsequent graphs should be build from Graph Management, then. Thus, you are able to specify already existing data source without having to poll them again
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 10:49 am 
Offline

Joined: Thu Mar 20, 2008 12:30 pm
Posts: 22
Thanks for the reply. Neither approach sounds ideal. They take a lot of work, a lot of disk space, or a lot of SSH calls. Maybe there are some other ways to solve this.

It sounds like Cacti does not cache multiple calls to the same script, which I already guessed by looking at the cacti.log file. Would caching (within the same polling cycle) be a reasonable solution? It seems to me it would have some other benefits, such as making sure all data is totally consistent within the polling cycle.

If Cacti cannot do this, I might either a) add it myself or b) hack my scripts so they write their last result into /tmp/[script]_[hostname].txt and check for a cache hit (a file less than 5 minutes old) before actually going to fetch the data. Can you comment on the dangers or benefits of such an approach?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 21, 2008 11:07 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
xaprb wrote:
Thanks for the reply. Neither approach sounds ideal. They take a lot of work, a lot of disk space, or a lot of SSH calls. Maybe there are some other ways to solve this.
Qou're quite right, unfortunately

Quote:
It sounds like Cacti does not cache multiple calls to the same script, which I already guessed by looking at the cacti.log file. Would caching (within the same polling cycle) be a reasonable solution? It seems to me it would have some other benefits, such as making sure all data is totally consistent within the polling cycle.
Sure. It's an old request. But no code has been contributed yet

Quote:
If Cacti cannot do this, I might either a) add it myself or b) hack my scripts so they write their last result into /tmp/[script]_[hostname].txt and check for a cache hit (a file less than 5 minutes old) before actually going to fetch the data. Can you comment on the dangers or benefits of such an approach?
Approach b) is the current workaround. Approach a) would be the better one.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 7:51 pm 
Offline

Joined: Thu Mar 20, 2008 12:30 pm
Posts: 22
I used caching. Part 1 of my work is now available: improved MySQL templates for Cacti. http://www.xaprb.com/blog/2008/04/27/im ... for-mysql/


Top
 Profile  
 
 Post subject: mysql graphs are not updating
PostPosted: Fri May 16, 2008 1:10 pm 
Offline
Cacti User

Joined: Thu May 17, 2007 9:18 am
Posts: 233
I placed the php script to /cacti/scripts directory and changed to username and password to system privileged account. I can mannually run the script from the command line and I can see that it is returning some values. But when I add a mysql device, the graphs are not updating. Am I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 18, 2008 8:27 am 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
When cacti's poller runs the script, the "cactiuser" account (or whatever you use from crontab) is used. This userid must be provided with the MySQL priviledges required for the script.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject: mysq graphs are not updatin
PostPosted: Mon May 19, 2008 10:04 am 
Offline
Cacti User

Joined: Thu May 17, 2007 9:18 am
Posts: 233
I provided privileges to the cactiuser account by doing this:

GRANT ALL PRIVILEGES ON *.* TO 'cactiuser'@'%'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION

GRANT ALL PRIVILEGES ON *.* TO 'cactiuser'@'localhost'
-> IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
graphs are still not updating. I dont see any rrd files being created.


Top
 Profile  
 
 Post subject: Re: mysql graphs
PostPosted: Mon May 19, 2008 10:35 am 
Offline
Cacti User

Joined: Thu May 17, 2007 9:18 am
Posts: 233
when I try to add devices using mysql host template, cacti poller is reporting the following error:

om SNMP not valid. Partial Result: ...
230 [main] ? (5436) C:\cygwin\bin\sh.exe: *** fatal error - system shared me
mory version mismatch detected - 0x2D1E009C/0x8A88009C.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 24, 2008 3:08 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22461
Location: Muenster, Germany
Moved to windows due to possible cygwin issues.
Reinhard

_________________
Official Cacti Documentation
Official Debugging Help
Central Plugin Repository
Central Templates Repository


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 26, 2008 12:26 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 11316
Location: USA
gsaray101: Did you do what the cygwin error message instructed?

_________________

| 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 |


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group