David, About the maths: You need 2 oid's at both sides of the '+'. So find an oid that always returns 0, and next line should do the trick:
Target[SNMP_TEST]: snmpInGetNexts.0:[EMAIL PROTECTED]&<some oid returning a zero> + snmpInGetRequests.0:[EMAIL PROTECTED]&snmpOutGetResponses.0:[EMAIL PROTECTED] About upgrading: I don't think there is need to upgrade only for making the maths work. I do remember however that after upgrading from MRTG 2.8.something to MRTG 2.9. my targets with maths went wrong. The only way I got them working again was by using the whole numerical oid. I never changed them back to the named oid. So I do not know if you still have to use the full numeric oid in your and/or the latest version of MRTG. Hth, Jan. -----Original Message----- From: CHENG, DAVID (PB) [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2003 3:58 PM To: '[EMAIL PROTECTED]' Subject: [mrtg] Math and Upgrading OK, these are two fairly lame questions, but please bear with me. 1) I have not tried to add targets (other than simple examples) in the past, so this is my first experience. I've tried to RTFM, but I must be confusing myself or something. Anyway, I have a configuration file that is trying to add snmpInGetNexts and snmpInGetRequests, then get snmpOutGetResponses (Yes, I realize that MRTG will cause these counters to change; kinda like Heisenberg's Uncertainty Principle). I can retrieve data for each individual MIB without a problem, but when I try to add them, I get error messages. I have tried these target strings and received the following errors: Target[SNMP_TEST]: snmpInGetNexts.0:[EMAIL PROTECTED] + snmpInGetRequests.0:[EMAIL PROTECTED]&snmpOutGetResponses.0:[EMAIL PROTECTED] sh-2.05$ mrtg snmp_test.cfg Use of uninitialized value in string eq at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1138. Use of uninitialized value in string eq at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1138. Use of uninitialized value in string eq at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1139. Use of uninitialized value in string eq at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1139. Use of uninitialized value in concatenation (.) or string at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1148. Use of uninitialized value in concatenation (.) or string at /usr/local/mrtg-2/bin/../lib/mrtg2/MRTG_lib.pm line 1148. cannot encode Object ID 10.11.34.1: first subid too big in Object ID 10.11.34.1 at /usr/local/mrtg/bin/mrtg line 1607 WARNING: skipping because at least the query for 10.11.34.1 on 10.11.34.1 did not succeed Use of uninitialized value in string eq at /usr/local/mrtg/bin/mrtg line 1545. Use of uninitialized value in string eq at /usr/local/mrtg/bin/mrtg line 1545. Use of uninitialized value in hash element at /usr/local/mrtg/bin/mrtg line 1551. Use of uninitialized value in hash element at /usr/local/mrtg/bin/mrtg line 1551. Use of uninitialized value in hash element at /usr/local/mrtg/bin/mrtg line 1555. Use of uninitialized value in hash element at /usr/local/mrtg/bin/mrtg line 1555. Use of uninitialized value in concatenation (.) or string at /usr/local/mrtg/bin/mrtg line 1556. Use of uninitialized value in concatenation (.) or string at /usr/local/mrtg/bin/mrtg line 1556. WARNING: Could not match host:'[EMAIL PROTECTED]' ref:'' key:'' ERROR: Target[isd_rsm_cpu][_IN_] 'snmpInGetNexts. $$target[1]{$mode} + snmpInGetRequests.0:EnLA0201@ $$target[0]{$mode} ' (warn): Array found where operator expected at (eval 6) line 1, at end of line ERROR: Target[isd_rsm_cpu][_OUT_] 'snmpInGetNexts. $$target[1]{$mode} + snmpInGetRequests.0:EnLA0201@ $$target[0]{$mode} ' (warn): Array found where operator expected at (eval 7) line 1, at end of line Or, another target string yields this error: Target[SNMP_TEST]: snmpInGetNexts.0 + snmpInGetRequests.0&snmpOutGetResponses.0:[EMAIL PROTECTED] ERROR: Target[isd_rsm_cpu][_IN_] 'snmpInGetNexts.0 + $$target[0]{$mode} ' (eval): Bareword "snmpInGetNexts" not allowed while "strict subs" in use at (eval 6) line 1. ERROR: Target[isd_rsm_cpu][_OUT_] 'snmpInGetNexts.0 + $$target[0]{$mode} ' (eval): Bareword "snmpInGetNexts" not allowed while "strict subs" in use at (eval 7) line 1. I think I am missing something really stupid, but I'm tired right now, and I hope you guys will overlook this. I could add these values in an external script, but I figured the math would be easier...:) 2) I don't know if this has anything to do with this issue, but I am currently running MRTG 2.9.22, RRDTOOL 1.0.39, and 14all.cgi 1.1p23. I know that there are newer versions of all these programs out there, but this has been running smoothly for months, so I haven't thought about upgrading. Any compelling reasons to upgrade at this time? Also, I lost my previous upgrade notes (if I upgrade, this will be my second time upgrading), but I seem to remember that it was fairly painless to upgrade. I think all I did was configure;make;make install (maybe I never made any notes before because it was that easy?). Is that still true, or do I need to be careful of anything overwriting something that I don't want overwritten? Thanks for indulging me and wading through this post. Best Regards, David Cheng -- 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 Het ministerie van Sociale Zaken en Werkgelegenheid sluit elke aansprakelijkheid uit in verband met het niet juist, onvolledig of niet tijdig overkomen van de informatie in deze e-mail. Aan dit bericht kunnen geen rechten worden ontleend. Dit bericht is alleen bestemd voor de geadresseerde. Indien dit bericht niet voor u bestemd is, verzoeken wij u dit onmiddellijk aan ons te melden en de inhoud van het bericht te vernietigen. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The ministry of Social Affairs and Employment is not liable for any incorrect or incomplete transmission of the information in this e-mail or for any delay in its receipt. This message shall not constitute any obligations. This message is intended solely for the addressee. If you have received this message in error, please inform us immediately and delete its content. -- 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
