integrate rrdcached with mrtg

2 messages Options
Embed this post
Permalink
Stuart Kendrick () integrate rrdcached with mrtg
Reply Threaded More More options
Print post
Permalink
So what does it take to integrate rrdcached with MRTG?

 From a quick & dirty point of view, it seems to me that I could change line 854
(mrtg-2.16.2) as follows:

from
         if ( $RRDs::VERSION >= 1.2 ){
             $rrddata=RRDs::updatev($dotrrd, "$time:$inlast:$outlast");
         } else {
             RRDs::update($dotrrd, "$time:$inlast:$outlast");
         }

to

         if ( $RRDs::VERSION >= 1.2 ){
             $rrddata=RRDs::updatev($dotrrd, "--daemon
unix:/tmp/rrdcached.sock", "$time:$inlast:$outlast");
         } else {
             RRDs::update($dotrrd, "$time:$inlast:$outlast");
         }

Is it this easy?  Or am I totally missing how hard this is?

--sk

Stuart Kendrick
FHCRC

_______________________________________________
mrtg mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
JL mrtg () Re: integrate rrdcached with mrtg
Reply Threaded More More options
Print post
Permalink
Hi

I use RRDCACHED_ADDRESS environment variable:
  export  RRDCACHED_ADDRESS=127.0.0.1

I run rrdcached as:
  rrdcached -l 127.0.0.1 <more params>

but when I run mrtg I get:
  ERROR: Cannot update file.rrd with '1257937902:14296586674:19866901102' The "RRDCACHED_ADDRESS" environment variable is defined, but "dummy" cannot work with rrdcached. Either unset the environment variable or use "update" instead

:(

Stuart Kendrick wrote:
So what does it take to integrate rrdcached with MRTG?

 From a quick & dirty point of view, it seems to me that I could change line 854
(mrtg-2.16.2) as follows:

from
         if ( $RRDs::VERSION >= 1.2 ){
             $rrddata=RRDs::updatev($dotrrd, "$time:$inlast:$outlast");
         } else {
             RRDs::update($dotrrd, "$time:$inlast:$outlast");
         }

to

         if ( $RRDs::VERSION >= 1.2 ){
             $rrddata=RRDs::updatev($dotrrd, "--daemon
unix:/tmp/rrdcached.sock", "$time:$inlast:$outlast");
         } else {
             RRDs::update($dotrrd, "$time:$inlast:$outlast");
         }

Is it this easy?  Or am I totally missing how hard this is?

--sk

Stuart Kendrick
FHCRC

_______________________________________________
mrtg mailing list
mrtg@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg