[mrtg] arithmetic in mrtg?

paul beard paulbeard at mac.com
Sun Apr 13 08:09:20 MEST 2003


I've been hunting around for some way to take values from mrtg's snmpgets and multiply them by a value (in my case, 4) and nothing I have found seems to work. 

[/usr/local/etc/mrtg]# snmpget -Ov -cpaulbeard.org pink hrStorageUsed.6 
INTEGER: 5658

Target[pink-scratch]:hrStorageUsed.6&hrStorageSize.6:paulbeard.org at pink works fine, but it's not what I want. I would like either to divide one by the other or to multiply both by 4 (for some reason the results are coming back at 1/4 the real size). 

For one thing, if I just try one value, I get an error. 

Target[pink-scratch]:hrStorageSize.6:paulbeard.org at pink 

SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 2 (OID: 1.3.6.1.2.1.2.2.1.16.6)
SNMPv1_Session (remote host: "pink" [192.168.2.3].161)
                  community: "paulbeard.org"
                 request ID: 2024956674
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/local/lib/perl5/site_perl/5.6.1/SNMP_util.pm line 458
SNMPGET Problem for ifInOctets.6 ifOutOctets.6 sysUptime sysName on paulbeard.org at pink
 at /usr/local/bin/mrtg line 1620
WARNING: skipping because at least the query for ifInOctets.6 on  pink did not succeed
ERROR: Target[pink-scratch][_IN_] 'hrStorageSize. $$target[4]{$mode} ' (eval): Bareword "hrStorageSize" not allowed while "strict subs" in use at (eval 26) line 1.

ERROR: Target[pink-scratch][_OUT_] 'hrStorageSize. $$target[4]{$mode} ' (eval): Bareword "hrStorageSize" not allowed while "strict subs" in use at (eval 27) line 1.

WARNING: Skipping Update of pink-scratch, inlast is not defined
WARNING: Skipping Update of pink-scratch, outlast is not defined

This is with mrtg 2.9.25 on FreeBSD and Darwin 6.5. 

--
Paul Beard / 8040 27th Ave NE / Seattle WA 98115 /
paulbeard [at] mac [ dot] com / 206 529 8400

weblog @ <http://paulbeard.no-ip.org/movabletype/>

--
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