[mrtg] Perl external command ?!!

BALLO Ismaël iballo at afribone.net.ml
Tue Dec 3 13:11:53 MET 2002


Hi,

I use a perl external command which works well when calling from the command
line :
Target[bmpcmali_error]: `/usr/bin/perl bm_rssi_error.pl bmpcmali`
but which returns errors when called from cfg file (by crontab) :

2002-12-03 12:00:02 -- WARNING: Could not get any data from external command
'/usr/bin/perl bm_rssi_error.pl bmcpssante'
Maybe the external command did not even start. (Illegal seek)

I don't understand why.
Permissions are correct. All being executable by root.

Is it maybe the argument ?

Here is the perl script bm_rssi_error.pl :

#!usr/bin/perl
use Math::Round qw(round);
my $rssi;my $ret;my $tr;my $error_rate;
$rssi=`snmpget $ARGV[0] public .1.3.6.1.4.1.710.3.3.8.3.1.0`;
$rssi=~/"(\d*)"|(\d*)$/;if ($1 ne "") {$rssi=$1;} else { $rssi=$2; }
$ret=`snmpget $ARGV[0] public .1.3.6.1.4.1.710.3.3.8.2.3.3.0`;
$ret =~/(\d*)$/;$ret=$1;
$tr=`snmpget $ARGV[0] public .1.3.6.1.4.1.710.3.3.8.2.3.1.0`;
$tr =~/(\d*)$/; $tr=$1;
$error_rate=round($ret/($ret+$tr)*100);
print $rssi."\n";
print $error_rate."\n";

--
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
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list