[mrtg] Conversion code error

Steve Shipway s.shipway at auckland.ac.nz
Wed Jun 24 04:10:58 CEST 2009


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: mrtg-bounces at lists.oetiker.ch [mailto:mrtg-bounces at lists.oetiker.ch] 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;
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20090624/d7ce7144/attachment-0001.html 


More information about the mrtg mailing list