[mrtg] problem using result from external script

nicolas.pigeau at paribas.com nicolas.pigeau at paribas.com
Fri May 12 10:34:41 MEST 2000

Hi All,

Here is my (new) problem: using an external script to get "input errors" on two
interfaces and display them on the same graph.

I attached the script I created at the end of this mail.
I tested it, and it seems to me that the result are OK (I compared the result
with an snmpget, and quite surprisingly, the result is the same...)
But when I use it with MRTG, I get an:
 ""  Problem with Externale get '`/opt/mrtg-2.8.9/run/my_contrib/get_errors.pl public 2 public 4`':
    Expected an INTEGER for 'out' but got ''  ""      (same problem with "in").

I compared my script with scripts found in the "contrib" folder, and I didn't
find any special trick to return the result...
And it looks like MRTG try to convert the result in an integer, but after that:
     1: the graph are empty or show "wrong" data.
     2: when checking the .log files, the data look wrong, as the first line
should be the last polled data, and it's not...

Any help, or anyone who had same kind of problem.....



ps: By the way, I found out using MRTG that "MaxBytes[]" is quite a dangerous
parameter: set too small, you don't get anything on the graph,
or worst, you think it's ok, but in fact all the graphs are "truncated"....

if ( scalar(@ARGV) > 6 || scalar(@ARGV) == 0 )
   print("USAGE: get_errors.pl IP_router_1 Community_name_1 mib_instance
IP_router_2 Community_name_2 mib_instance\n");
$IP_1 = $ARGV[0];
$Com_nam_1 = $ARGV[1];
$mib_1 = $ARGV[2];
$IP_2 = $ARGV[3];
$Com_nam_2 = $ARGV[4];
$mib_2 = $ARGV[5];
$getsnmp_1 = `snmpget -c $Com_nam_1 -r 3 $IP_1$mib_1`;
$getsnmp_1 =~ /^interfaces.ifTable.ifEntry.ifInErrors.\d+\s\D\sCounter:\s(\d+)/;
print $1."\n";
$getsnmp_2 = `snmpget -c $Com_nam_2 -r 3 $IP_2$mib_2`;
$getsnmp_2 =~ /^interfaces.ifTable.ifEntry.ifInErrors.\d+\s\D\sCounter:\s(\d+)/;
print $1."\n";
print "--\n";
print $IP_1." instance ".$mib_1.", and ".$IP_2." instance ".$mib_2."

This message is confidential; its contents do not constitute a
commitment by BNP Paribas Group* except where provided 
for in a written agreement between you and BNP Paribas Group*. 
Any unauthorised disclosure, use or dissemination, either 
whole or partial, is prohibited. If you are not the intended 
recipient of the message, please notify the sender immediately.
*BNP Paribas Group  is a trading name of BNP SA and Paribas SA

Ce message est confidentiel; son contenu ne represente en 
aucun cas un engagement de la part du groupe BNP Paribas* 
sous reserve de tout accord conclu par ecrit entre vous et le 
groupe BNP Paribas*. Toute publication, utilisation ou diffusion, 
meme partielle, doit etre autorisee prealablement. Si vous n'etes 
pas destinataire de ce message, merci d'en avertir immediatement
*Le groupe BNP Paribas est le nom commercial utilise par BNP SA et Paribas SA

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