[mrtg] external program help

Steve Meier smeier at SDSC.EDU
Thu May 11 18:18:29 MEST 2000


How's it going!

Here is my problem. I wrote a script that reads in a ping from a file
and parses out the % loss. It's ugly (first script, forgive me) but it
works. When I fire just the perl script, it works fine.  When I try to
fire it under mrtg, I get the error:  "The system cannot find the file
c:\mrtg\ping\pingloss.pl.

Could not get any data from external command 'c:\mrtg\ping\pingloss.pl'

Maybe the externam command did not even start. (No such file or
directory)"

Here's what I got...

#sets file path
$pingfile = '/test/ping/ping.txt';

##Open ping File

open (INPING, $pingfile); {    #first brace

while(<INPING>) {

 $all = $_;

if($all =~ m/Lost/) {

 {$gotloss = $all};

if($gotloss =~ /\((.+?)/) {

 {$pingloss = $1}
 print  0 \n"; #not used
 print  $pingloss \n";
 print  placeholder \n"; #will change values later
 print  placeholder \n";
}
}
}
}
#end

I looked at various contrib scripts and I copied the output format of
theres to put into mrtg.

Now, here is the config for the script:
***********************************************************************
workdir: \inetpub\wwwroot

Title[^]: CPU Usage in MegaBytes on System:


workdir: \inetpub\wwwroot

Title[^]: CPU Usage in MegaBytes on System:


Target[ping]: `c:\mrtg\ping\pingloss.pl`
MaxBytes[ping]: 100
Title[ping]: ping test
PageTop[ping]: <H2>ping  </H2>
Options[ping]: gauge, nopercent, absolute, growright
Unscaled[ping]: dwmy
#Supress[ping]:dwmy
XSize[ping]: 380
YSize[ping]: 110
YLegend[ping]: ping test
#ShortLegend[ping]:
Legend1[ping]: ping
Legend2[ping]:ping
#Legend3[ping]:
#Legend4[ping]:
#LegendI[ping]:
LegendO[ping]:
********************************************************************************************

Anyone have any sugestions?

Thanks,

Steve



-- Attached file removed by Listar and put at URL below --
-- Type: text/x-vcard
-- Desc: Card for Steve Meier
-- Size: 221 bytes
-- URL : http://www.ee.ethz.ch/~slist/pantomime/04-smeier.vcf


--
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



More information about the mrtg mailing list