Re: Getting error from MRTG when running external script
Alex van den Bogaerdt <[email protected]> Tue, 18 Mar 2008 04:56:17 +0100
| Newsgroups | gmane.network.mrtg.devel |
|---|---|
| Message-ID | <[email protected]> |
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.