Problem with MRTG

I have a problem using an external script in MRTG. When i run the mrtg.cfg file appears:

WARNING: I can’t find a “Target[169.254.1.247-temperature]” definition


but if i run the script “/usr/local/src/mrtg-2.12.2/bin/getcanopytemp.pl $@169.254.1.247 $@xxxxxx $@1.3.6.1.4.1.161.19.3.3.1.5.0” from the shell it works well

This is the mrtg script section:

Target[169.254.1.247-temperature]: /usr/local/src/mrtg-2.12.2/bin/getcanopytemp.pl $@169.254.1.247 $@xxxxxx $@1.3.6.1.4.1.161.19.3.3.1.5.0
MaxBytes[canopy_temperature]: 255
Options[canopy_temperature]: integer, unknaszero, gauge, nopercent
XSize[canopy_temperature]: 600
Ylegend[canopy_temperature]: Temperature °C
ShortLegend[canopy_temperature]: °C   &nbsp
LegendI[canopy_temperature]: Temperature:
LegendO[canopy_temperature]:
Legend1[canopy_temperature]: Temperature in Degrees Celsius
Legend2[canopy_temperature]:
Legend3[canopy_temperature]:
Legend4[canopy_temperature]:
Title[canopy_temperature]: Temperature
PageTop[canopy_temperature]: <H1>Temperature</H1>
<TABLE>
<TR><TD>System:</TD> <TD>xxxxxxxx</TD></TR>
<TR><TD>Maintainer:</TD> <TD>xxxxxxxx</TD></TR>
<TR><TD>Description:</TD><TD>Temperature in degrees celsius</TD></TR>
</TABLE>

And this is the perl script (i took it from this forum):

#!/usr/bin/perl

# Usage: getcanoytemp.pl hostname snmpcomm OID

$host = shift;
$community = shift;
$oid = shift;

open (GET, “snmpget -v 2c $host -c $community .$oid|”);

while (<GET>) {
$data = $_;
}

($celsius,$fahrenheit) = ($data =~ /"(‘d+)&deg;C’/('d+)&deg;F"/);

print $celsius, “'n”;
print $celsius, “'n”;
print “0’n”;
print “0’n”;

Thanks :stuck_out_tongue:
(excuse me for the bad english, i’m italian)