<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">There now exists a patch to rrdtool (which has already been merged) that allows xymon to work with the following config-changes:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><br>
[rrdcache]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        LOGFILE $XYMONSERVERLOGS/rrdcached.log<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        NEEDS xymond<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        CMD $RRD_BASE/bin/rrdcached -w 1800 -z 900 -f 1800 -l $XYMONVAR/rrdcached/rrdcached.socket -j $XYMONVAR/rrdcached -p $XYMONVAR/rrdcached/rrdcached.pid
 -g -l 0.0.0.0:41984 -b $XYMONVAR/ -B<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[rrdstatus]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        CMD +--no-cache<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[rrddata]<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">        CMD +--no-cache<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">And in the ENVFILE /etc/xymon/xymonserver.cfg add:<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">RRDCACHED_ADDRESS="127.0.0.1:41984"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">RRDCACHED_STRIPPATH="$XYMONVAR"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"># these are there to override the default rrd install location<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"># so that it uses the head build from rrdtool<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">RRD_BASE="/opt/rrdtool-1.4.999"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">LD_LIBRARY_PATH="$RRD_BASE/lib/"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The patch to rrdtool:
<a href="https://github.com/oetiker/rrdtool-1.x/pull/462">https://github.com/oetiker/rrdtool-1.x/pull/462</a> has already been incorporated with the main development branch, so I hope it will get into the next rrdtool-1.4 release.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ciao,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                Martin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Xymon [mailto:xymon-bounces@xymon.com]
<b>On Behalf Of </b>Martin Sperl<br>
<b>Sent:</b> Dienstag, 29. April 2014 13:03<br>
<b>To:</b> Jeremy Laidman<br>
<b>Cc:</b> xymon@xymon.com<br>
<b>Subject:</b> Re: [Xymon] flushing rrd files<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks – the problem is that those sockets change so you have to “guess” their path and see if it is functional (as with your perl example – in my case there
 are actually 16 socket files in temp and I have to iterate over all of them to find the 2 that are actually working – slightly stupid...)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Obviously this also does not work from a remote node which only has access to the rrd files via NFS…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Meaning I have to write a http proxy for that…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">So I was wondering if xymond_rrd with the --no-cache would use the RRDCache if set in the environment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">My guess would be I need to use a different env file which has RRDCACHED_ADDRESS set correctly (which rrdtool makes use of automatically if the ENV is set)
 and then configure xymond_rrd to use that environment instead….<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If that works then that rrd-specific caching could get removed as a whole – with the exception of the need for
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I just want to avoid testing this on our live system, so I was asking if anyone has experience with this…<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Martin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Jeremy Laidman [<a href="mailto:jlaidman@rebel-it.com.au">mailto:jlaidman@rebel-it.com.au</a>]
<br>
<b>Sent:</b> Dienstag, 29. April 2014 04:33<br>
<b>To:</b> Martin Sperl<br>
<b>Cc:</b> <a href="mailto:xymon@xymon.com">xymon@xymon.com</a><br>
<b>Subject:</b> Re: [Xymon] flushing rrd files<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">I think work would need to be done to integrate with rrdcached.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The RRD stats are cached by xymond_rrd.  The showgraph.cgi binary sends a flush command to the xymond_rrd instances, via UNIX sockets, requesting a cache flush, so that graphs are up-to-date.  You could probably emulate this by running
 showgraph.cgi from the command-line.  Like so:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">SCRIPT_NAME=showgraph.sh REQUEST_METHOD=GET QUERY_STRING="host=<a href="http://hostname.example.com">hostname.example.com</a>&service=conn" /usr/lib/xymon/server/bin/showgraph.cgi >/dev/null<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In this case, the "conn" is not used for anything (all RRD files are flushed), but has to be a (I think) valid RRD filename (without the extension) or graph name (defined in graphs.cfg).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Also, if you can send a string directly to the two UNIX sockets, you can cause a flush.  The format is simply the hostname in slashes, like "/<a href="http://hostname.example.com">hostname.example.com</a>" and so you can probably achieve
 this using modern versions netcat or socat, or other things that can write to sockets.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">And just for fun, here's an implementation in Perl.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Jeremy<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">#!/usr/bin/perl -Tw<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">my $hostname=shift;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">die "Specify hostname\n" unless defined($hostname);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">my $socketdir=$ENV{XYMONTMP};<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">die "XYMONTMP not defined, run from xymoncmd\n" unless $socketdir;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">use Socket;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">socket(SOCK, AF_UNIX, SOCK_DGRAM, 0)  or die "socket: $!\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">my $flags = fcntl(SOCK, F_SETFL, O_NONBLOCK) or die "fcntl: $!\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">opendir(DIR,$socketdir) or die "$!: $socketdir\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">while(my $socketfile=readdir(DIR)) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        next unless substr($socketfile,0,7) eq "rrdctl.";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        my $socketpath="$socketdir/$socketfile";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        if (! -e $socketpath) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                warn "not found: $socketpath\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                next;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        if (! -w $socketpath) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                warn "not writeable: $socketpath\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                next;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        if (! -S $socketpath) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                warn "not a socket: $socketpath\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                next;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">        $socketaddr=sockaddr_un($socketpath);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">        if (defined(send(SOCK, "/$hostname/", 0, $socketaddr))) {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                print "Flush command for '$hostname' sent to $socketfile\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        } else {<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                warn "Flush command for '$hostname' failed to send to socket $socketfile\n";<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">        }<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">}<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 25 April 2014 22:29, Martin Sperl <<a href="mailto:Martin.Sperl@amdocs.com" target="_blank">Martin.Sperl@amdocs.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="DE-AT">Hi!</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="DE-AT"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Is there a means to flush the rrd files filled in from xymond_rrd say via the “xymon”  command?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">As an alternative is it possible to use the generic RRDCACHED as a replacement for the caching?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Any experience with that?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">                                Martin<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal">This message and the information contained herein is proprietary and confidential and subject to the Amdocs policy statement, you may review at
<a href="http://www.amdocs.com/email_disclaimer.asp" target="_blank">http://www.amdocs.com/email_disclaimer.asp</a>
<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>