[HOWTO] Use externally updated rrd files + BONUS TRACK

If you figure out how to do something interesting/cool in Cacti and want to share it with the community, please post your experience here.

Moderators: Moderators, Developers

Author
Message
colchaodemola
Posts: 17
Joined: Sun Feb 18, 2007 11:09 am

#16 Post by colchaodemola » Sun Feb 18, 2007 4:01 pm

ok i fix the syntax error now it prints :

filename = "/www/tc/imq1-tc.rrd"
rrd_version = "0003"
step = 10
last_update = 1171832429
ds[101_leaf].type = "DERIVE"
ds[101_leaf].minimal_heartbeat = 60
ds[101_leaf].min = 0.0000000000e+00
ds[101_leaf].max = NaN
ds[101_leaf].last_ds = "0"
ds[101_leaf].value = 0.0000000000e+00
ds[101_leaf].unknown_sec = 0

....


i think all chars are valid now . I am gonna try and post results :D

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#17 Post by gandalf » Sun Feb 18, 2007 4:30 pm

Ok, fine. As additional help, you may consider reading the first link of my signature. Find lots of walkthroughs there
Reinhard

colchaodemola
Posts: 17
Joined: Sun Feb 18, 2007 11:09 am

#18 Post by colchaodemola » Mon Feb 19, 2007 10:54 am

It works :)

Well , is there anyway to make cacti import ALL Data sources with out i have to type one by one ?

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#19 Post by gandalf » Mon Feb 19, 2007 11:47 am

AFAIK no, but this has not been searched for to the deepest extend, at least not by me :wink:
Please be aware, that this is more of a corner case and does not have that attention on it. So no one (AFAIK) has created code for this.
But if you decide to have a go on your own ...
Reinhard

detrak
Posts: 3
Joined: Wed May 02, 2007 1:52 pm

#20 Post by detrak » Wed May 02, 2007 5:45 pm

look this new tool :
http://sourceforge.net/projects/nagios2cacti/

n2cacti will load nagios config and n2rrd configuration and to create data_template, graph_template, and instantiate it for each host needed without user operation :
./n2cacti.pl -c /etc/n2rrd/n2rrd.conf -s -h

you just need to custom your graph after (color is defined randomly..) and put-it in the tree...

detrak
Posts: 3
Joined: Wed May 02, 2007 1:52 pm

#21 Post by detrak » Fri May 04, 2007 8:22 am

I have implemented a tool to integrate Nagios perfdata in Cacti,


http://sourceforge.net/projects/nagios2cacti/

it's based on n2rrd and your post to get the method to import rrd database in cacti.

mbhoward
Posts: 19
Joined: Wed Sep 05, 2007 4:31 pm

#22 Post by mbhoward » Wed Sep 05, 2007 4:44 pm

great post, thanks. taking this a step further, does anyone have any ideas as to how to make cacti ingest an external rrd from a separate box over the network? the rrd server example shows how to update an external RRD file but i would like cacti to fetch data from an rrd on another box instead of creating a local rrd. in other words, when creating a data source, instead of defining a path to a local rrd, i would like to point to an rrd on another box. NFS is not really an option for us. maybe there is some way to create a custom module which somehow "replaces" the data source? or maybe an easier solution which i've overlooked?

thanks for your help!

mark

wykk
Posts: 4
Joined: Mon Nov 20, 2006 9:54 pm

#23 Post by wykk » Thu Sep 06, 2007 9:45 pm

I've been tooling around for a bit trying to shoehorn this into working.

My dilemna is that I have hundreds of thousands of devices around the globe (each with one-to-many data sources) that I want to have accessable from a central 'master' cacti server.

I have a cacti lab built up with the express purpose of trying to get this working properly. Optimally, the plan is to build up a regional cacti slave and have it simply rsync it's rrd's to the global master, which would then be able to display data from everywhere, depending on how you drilled down through the trees.

I'm not exactly stuck, but it's definately slow going. Part of the process I want is the ability to export/import the tree structure from the slave and merge it into the master, but I haven't yet scripted that out. As far as that goes, I've been digging through a mysqldump and piecing together the relevant info for the pieces I'll need.

I know that in version 0.9.0, cacti is rumored to have the ability to work in a master/slave fashion, but with no ETA (at least not one that I've found) and a definate need for a less latency-suffering (crossing oceans, thousands of times per polling period, is less than ideal) solution required in the immediate future, I'll get when I can until then. Optimally, the end goal here is to have the cacti slaves themselves be able to act as masters themselves as well, perhaps regionally, adding a bit of redundancy in case the global cacti server itself were to die or something.

If I actually do manage to get this working, I'll do my best to post what I did in some sort of legible format...

mbhoward
Posts: 19
Joined: Wed Sep 05, 2007 4:31 pm

#24 Post by mbhoward » Fri Sep 07, 2007 11:09 am

thanks for the reply. wow, your problem is definitely much broader in scope than mine. i'm trying to get away from installing cacti on each server so i want one master cacti deployment to consume rrds which are managed on each separate box. i think i'm making good progress. i've added a remote rrd checkbox field to the data source and i'm now modifying rrd.php so that it checks to see if the data source should try and find the rrd remotely. if so, it will make a connection to rrd server (installed on each remote machine) and issue the fetch command over the wire. that's the theory at least. thanks for sharing. good luck!

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#25 Post by gandalf » Sat Sep 08, 2007 10:53 am

mbhoward wrote:great post, thanks. taking this a step further, does anyone have any ideas as to how to make cacti ingest an external rrd from a separate box over the network? the rrd server example shows how to update an external RRD file but i would like cacti to fetch data from an rrd on another box instead of creating a local rrd. in other words, when creating a data source, instead of defining a path to a local rrd, i would like to point to an rrd on another box.
There's no such solution ATM. You may want to add a feature request. This is kind of a globally dispersed rrd store
Reinhard

mbhoward
Posts: 19
Joined: Wed Sep 05, 2007 4:31 pm

#26 Post by mbhoward » Mon Sep 10, 2007 3:18 pm

thanks. i think i've figured out how to make it work:

- modified data source to include remote_rrd checkbox which indicates whether rrd should be fetched locally or remotely via rrdsrv
- modified rrdtool_execute (rrd.php) so that it sends rrdtool command to appropriate host if remote_rrd checkbox is checked

but this is a less than optimal solution for us since we'd rather not modify cacti code directly due to upgrade/maintenance issues. ideally, i would like to be able to get this to work by using the plug-in architecture but it doesn't seem like the requisite hooks are in place. please correct me if i'm wrong.

thanks for your help,

mark

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#27 Post by gandalf » Tue Sep 11, 2007 12:04 pm

mbhoward wrote:ideally, i would like to be able to get this to work by using the plug-in architecture but it doesn't seem like the requisite hooks are in place. please correct me if i'm wrong.
Sent a feature request for new hooks to cigamit, please
Reinhard

mbhoward
Posts: 19
Joined: Wed Sep 05, 2007 4:31 pm

#28 Post by mbhoward » Tue Sep 11, 2007 1:03 pm

ok, thanks. i opened feature request #0001000: support for globally dispersed rrd store. i can't figure out how to assign it to cigamit.

thanks again,

mark

mbhoward
Posts: 19
Joined: Wed Sep 05, 2007 4:31 pm

#29 Post by mbhoward » Tue Sep 11, 2007 2:09 pm

my feature request was just closed with the following note:

----------------------------------------------------------------------
rony - 09-11-07 15:06
----------------------------------------------------------------------
This is possible without modifying Cacti and I suggest you ask on the forums.

http://forums.cacti.net

This has been discussed many time in the past, sorry I don't have links to any of the discusssions

User avatar
TheWitness
Developer
Posts: 14834
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#30 Post by TheWitness » Wed Sep 12, 2007 5:16 pm

It's actually a very interesting topic. Something I might just write. But not at the moment. I am a bit distracted.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

Post Reply