Re: copy-to for flat files
| Newsgroups | gmane.network.cricket.user |
|---|---|
| Message-ID | <3D28EBDA36A6E6469582A86D3B5B639C01759EF9@tlrbeantmbx02.ERF.THOMSON.COM> |
We tend to run some reports nightly on our rrd files. If there's no
copy-to target to a flat file then it would take minimal scripting to
run this hourly on your rrd files. It will however generate higher IO
load on your disks.
For example, we use this to detect latent errors on networking ports:
#!/usr/bin/perl -w
use strict;
my @rrdout;
my $i = 0;
my $j;
my $err_in;
my $err_out;
while ($i < @ARGV) {
@rrdout = `/usr/bin/rrdtool fetch $ARGV[$i] AVERAGE -s
00:30am-1day -e 0am-0day -r 1800`;
$j = 0;
$err_in = 0;
$err_out = 0;
while ($j < @rrdout) {
if ($rrdout[$j] =~ /:/) {
# print "$rrdout[$j]";
@_ = split / /, $rrdout[$j];
$err_in += $_[3];
$err_out += $_[4];
}
$j++;
}
if (($err_in > 0.01) || ($err_out > 0.01)) {
print "$ARGV[$i]\n";
print "errors in:\t$err_in\n";
print "errors out:\t$err_out\n";
}
$i++;
}
You could adapt this to dump hour 5 minute values each hour into flat
files.
Take care.
// nick
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Goldblatt, Eric
> Sent: Tuesday, March 20, 2007 17:05
> To: [email protected]
> Subject: [cricket-users] copy-to for flat files
>
> Hello,
>
> Has anyone written any code for a copy-to type that sends data to flat
> files? I've seen this request a couple of times in the archive (see
> below), but I don't know the outcome.
>
> Eric Goldblatt
> Social Security Adminstration
>
>
>
> Date: Thu Jul 08 1999 - 10:09:26 PDT
> From: Jeff Allen
> > functionality to do this built into cricket? If not, I'm more than
> > willing to write and add a second copy-to filed type of
> file to log to
>
> > disk, just let me know if this functionality exists in some form or
> > another.
> copy-to is the "right' way to do this, but as you noted, it only
> supports traps right now. It was originally implemented for something
> we needed internally. I'd be happy to integrate other copy-to's,
> especially a file-like one.
>
>
>
> --------------------------------------------------------------
> -----------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the
> chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge
> &CID=DEVDEV
> _______________________________________________
> cricket-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cricket-users
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV