[mrtg-developers] Getting error from MRTG when running external script

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Mar 18 04:56:17 CET 2008


On Mon, Mar 17, 2008 at 09:39:40PM -0500, Scott S. Heath wrote:

> Here is the Perl code:
> 
> #!/usr/bin/perl
> $FileName = $ARGV[0];
> open(queueFile, "$FileName");
> my $queueFile = <queueFile>;
> $queueFile =~ s/copyqueuelength                  : //gi;
> 
> print $queueFile;
> print "0\n";
> print "0\n";
> print "CopyQueueLength";


If queueFile equals 200, this script will output:

"2000
0
CopyQueueLength"

whereas you probably want:

"200
0
0
CopyQueueLength
"

Notice: you have three lines with two linefeeds, I wrote four lines with
four linefeeds.

Don't know if that is the problem or not, I just noticed.



More information about the mrtg-developers mailing list