[mrtg] Re: getlog.pl
Jerry Heidtke
jheidtke at fmlh.edu
Mon Dec 16 17:51:39 MET 2002
Here's the original getlog.pl.
# getlog.pl
#
# Author: Paul Simmonson
#
# Input: filename of Windows 2000 Performance monitor log file (must be CSV
format)
# Name of log item to extract
# eg. perl getlog-fixed.pl c:\perflogs\K6.csv "\\K6\LogicalDisk(C:)\% Disk
Time"
# Output: mrtg data format
#
$STUFF=@ARGV[0];
open STUFF or die "Cannot open $STUFF for read :$!";
@entries = <STUFF>;
@details=split /,/, @entries[0]; #get the first line of the log file
@lastline=split /,/, @entries[$#entries]; #get last line of log file
#find the entry that matches $ARGV[1]
$index=-1;
for $entry (@details) {
$index++;
$entry=~ tr/"//d;
chomp ($entry);
$last=$entry;
last if $entry eq $ARGV[1];
}
if ($last eq $ARGV[1]) {
$data=@lastline[$index];
$data=~ tr/"//d;
$data = int($data+0.5);
} else {
$data = 0;
}
print "0\n";
print "$data\n";
print "0\n";
print "0\n";
-----Original Message-----
From: Paul Cousins [mailto:paul at pimper.fsnet.co.uk]
Sent: Monday, December 16, 2002 10:36 AM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] getlog.pl
I am trying to get mrtg tom import perfmon logs. however the scripts call a
getlog.pl perl script where is or how do i get hold of this getlog.pl?
anyhelp much appreciated.
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
Confidentiality Notice: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list