OK, so we have a problem in evaluation.  I can't duplicate it here for some 
reason, though.

Can you make sure that the last line of the TempConv.pl file is blank?  IE, it 
ends with \n\n as this MAY confuse some perls on evaluation
Also, remove the initial #! Line - you don't need it.
Finally, just make sure you're not using Unicode when making this file (I 
notice a Chinese name and so its possible you have Unicode enabled).  It should 
be plain ASCII.

The error message mentions line 1, EOF which is odd because MRTG prepends 1 or 
2 lines to start with.  So, check the permissions on the TempConv.pl file - 
make sure it is world readable and accessible, although MRTG should catch this 
case.  It is also possible that your perl has something against 'package' 
directives.  Finally make sure you don't have multiple ConversionCode 
directives in the file.

HTH

Steve

________________________________
From: [email protected] [mailto:[email protected]] On 
Behalf Of Yang Xiao

env LANG=C /usr/bin/mrtg /etc/mrtg/Filer-Temperatures.
cfg
ERROR: File /etc/mrtg/TempConv.pl conversion code evaluation failed
syntax error at (eval 17) line 1, at EOF
...
#!/usr/bin/perl
# Conversion Code
sub String2Temp {
        my $str = shift;
        $str =~ /\((\d+)F\)(.*)ambient.*/i;
        my $temp = $1;
        return $temp;
}

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg

Reply via email to