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[]” definition

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

This is the mrtg script section:

Target[]: /usr/local/src/mrtg-2.12.2/bin/ $@ $@xxxxxx $@
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:
Legend1[canopy_temperature]: Temperature in Degrees Celsius
Title[canopy_temperature]: Temperature
PageTop[canopy_temperature]: <H1>Temperature</H1>
<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>

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


# Usage: 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)