|
|
| Author |
Message |
xaprb
Joined: 20 Mar 2008 Posts: 22
|
Posted: Thu Mar 20, 2008 12:44 pm Post subject: Avoiding duplicated RRD files |
|
|
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. |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Fri Mar 21, 2008 9:08 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
xaprb
Joined: 20 Mar 2008 Posts: 22
|
Posted: Fri Mar 21, 2008 10:49 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Fri Mar 21, 2008 11:07 am Post subject: |
|
|
| 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 |
|
| Back to top |
|
 |
xaprb
Joined: 20 Mar 2008 Posts: 22
|
|
| Back to top |
|
 |
gsaray101 Cacti User
Joined: 17 May 2007 Posts: 181
|
Posted: Fri May 16, 2008 1:10 pm Post subject: mysql graphs are not updating |
|
|
| 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? |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Sun May 18, 2008 8:27 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
gsaray101 Cacti User
Joined: 17 May 2007 Posts: 181
|
Posted: Mon May 19, 2008 10:04 am Post subject: mysq graphs are not updatin |
|
|
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. |
|
| Back to top |
|
 |
gsaray101 Cacti User
Joined: 17 May 2007 Posts: 181
|
Posted: Mon May 19, 2008 10:35 am Post subject: Re: mysql graphs |
|
|
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. |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 17009 Location: Muenster, Germany
|
Posted: Sat May 24, 2008 3:08 pm Post subject: |
|
|
Moved to windows due to possible cygwin issues.
Reinhard |
|
| Back to top |
|
 |
BSOD2600 Cacti Moderator
Joined: 08 May 2004 Posts: 9568 Location: WA, USA
|
Posted: Mon May 26, 2008 12:26 pm Post subject: |
|
|
| gsaray101: Did you do what the cygwin error message instructed? |
|
| Back to top |
|
 |
|