I could run correctly mrtg by typing the command, but from the cron table it was not working correctly. the problem was that, when called by the cron, "snmpget" was not foung in the env path, and so on no result were given back to mrtg, which just display nothing... apparently the "env" i used when logged, and the "env" used by cron is not the same... problen resolved by giving the whole path of snmpget in the perl script. Im sure an unix guru would have solved that by giving good path when running as a cron, but... Thanks for your help, Nicolas (Embedded image moved to file: pic18954.pcx) From: Viana Gomes@BNP on 12/05/2000 12:48 To: Nicolas PIGEAU cc: bcc: Subject: Re: [mrtg] problem using result from external script (Document link not converted) Hi Nicolas. Have tried to run the script outside mrtg ? You can try to "chomp" the variables...like this: .... $getsnmp_1 =~ /^interfaces.ifTable.ifEntry.ifInErrors.\d+\s\D\sCounter:\s(\d+)/; chomp $getsnmp_1; I'had to use this trick with several of my scripts. Best regards. Viana Gomes BNP Portugal nicolas.pigeau@paribas.com on 12-05-2000 09:34:41 To: mrtg@list.ee.ethz.ch cc: (bcc: Viana Gomes/DOI_SYSTEMS/LISBOA/BFI/BNP) Subject: [mrtg] problem using result from external script 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 20.20.20.1 public 2 20.20.20.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..... Thanks, Nicolas 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".... #!/usr/bin/perl #get_errors.pl 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"); exit(-1); } $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 1.3.6.1.2.1.2.2.1.14.$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 1.3.6.1.2.1.2.2.1.14.$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." (ifInErrors).\n"; exit(0); #EOF ---------------------------------------------------------------------------------------------- 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 l'expediteur. *Le groupe BNP Paribas est le nom commercial utilise par BNP SA et Paribas SA -- Unsubscribe mailto:mrtg-request@list.ee.ethz.ch?subject=unsubscribe Archive http://www.ee.ethz.ch/~slist/mrtg FAQ http://faq.mrtg.org Homepage http://www.mrtg.org -- Attached file removed by Listar and put at URL below -- -- Type: application/octet-stream -- Size: 2k (2880 bytes) -- URL : http://www.ee.ethz.ch/~slist/pantomime/pic18954.pcx -- Unsubscribe mailto:mrtg-request@list.ee.ethz.ch?subject=unsubscribe Archive http://www.ee.ethz.ch/~slist/mrtg FAQ http://faq.mrtg.org Homepage http://www.mrtg.org