On Fri, 2003-09-26 at 13:22, Duane Cox wrote:
> Hey guys:
> Is there a easy way to graph an integer with MRTG based on getting 2 OID 
> values, adding them, dividing that by another OID, then multiplying by 100 
> ??? :)

Yes, write an external program.  Call it "find_result.pl" or some
such...
#!/usr/bin/perl -w
use lib qw(/usr/local/mrtg-2/lib/mrtg2/);
use SNMP_util;
my ($first, $second, $third) = snmpget($ARGV[0],
        '1.3.6.1.4..',  #replace this with the first OID
        '1.3.6.1.4..',  #and the second oid, etc...
        '1.3.6.1.4..');
my $result =  100 * ($first+$second) / $third;
print "$result\n0\n0\n0\n";

then call the program with:

Target[somename]: `find_result.pl [EMAIL PROTECTED]
maxbytes[somename]: 100
options[somename]: gauge
-- 
Daniel J McDonald, CCIE 2495, CNX
Austin Energy


--
Unsubscribe mailto:[EMAIL PROTECTED]
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

Reply via email to