On Thu, 2009-07-23 at 16:37 +0100, Niall O'Reilly wrote: > Hello. > > I want to provide some variables to a template for conditional > generation of targets related to IPv4 multicast. > > I've identified the OIDs I seem to need and changed cfgmaker > so that they are requested from the equipment and their status > placed in variables for use by the template.
> Thanks in advance for any helpful suggestions.
When you walk them by hand, you are using snmp v2c. Since you've
obfuscated the debug, I can't tell if you are using v1 or v2c when
running the template. Under v1, a COUNTER64 would simply not return.
Rather than hacking up cfgmaker, I normally poll the variables in my
template, just performing an snmpget. e.g (from a host template)
my ( $maxmins, $maxsec, $absmin, $yellowvolts, $redvolts,
$absvolts, @basis );
snmpMIB_to_OID("/usr/share/snmp/mibs/ups.mib");
snmpMIB_to_OID("/usr/share/snmp/mibs/LIEBERT_GP_REG.MIB");
snmpMIB_to_OID("/usr/share/snmp/mibs/LIEBERT_GP_POWER.MIB");
my ($model) = snmpget($router_connect,"upsIdentModel.0");
my ($version) =
snmpget($router_connect,"upsIdentAgentSoftwareVersion.0");
push @basis, 'upsEstimatedMinutesRemaining.0';
push @basis, 'upsConfigInputVoltage.0';
push @basis, 'upsConfigOutputVoltage.0';
push @basis, 'upsInputNumLines.0';
push @basis, 'upsOutputNumLines.0';
push @basis, 'upsConfigOutputFreq.0';
push @basis, 'upsConfigOutputVA.0' if $model !~ /Nfinity/;
#push @basis, 'lgpPwrLineMeasurementVoltsLL.3.1' if $model !
~ /Nfinity/ and $ver
sion !~ /^(1|2.0)/;
my ($remain,$volts,$ovolts,$ilines,$olines,$freq,$va)=
snmpget($router_connect,@basis);
You could do something similar in an iftemplate, replacing .0
with .$if_index
--
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
www.austinenergy.com
signature.asc
Description: This is a digitally signed message part
_______________________________________________ mrtg mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
