[mrtg] FreeBSD Ports: MRTG + Nagios + Net-SNMP + p5-*

Brian A. Seklecki lavalamp at spiritual-machines.org
Mon Mar 6 17:22:57 MET 2006

Right then, so on Friday I reported to mrtg at lists.ee* that a new box I had 
built wasn't letting MRTG honor "LoadMIBs:" arguments in configs.  A 
ktrace(8) revealed that perl(1) wasn't even attempting to fopen() any of 
the MIB resolution modules (i.e,, not "use/import;"'ing them).  See the 
verbose error below.

It turns out that there is conditional code in MRTG that will depend one 
SNMP module over another based on the config.  Maybe some of the MRTG guys 
can shed some light on this?  I don't have time to pick through the code.

However, I'm having trouble recreating the problem now, and none of the 
ports in question have been modified in CVS.  I suspect it was some race 
condition related to the order in which I installed the packages and an 
overlapping PLIST.

However, I'm out of time to troubleshoot this (not that I had time to deal 
with this in the first place, but since it occupied time on the initial 
troubleshooting, I figured I'd allocate some time to try to track it 

Essentially, the problem revolves around the build/run dependencies of 
ports/net-mgmnt/mrtg/ which are:


However, if you install Nagios on the same box (an entirely plausible 
scenario) and WITH_NETSMP is set in make config, you also get:

.if defined(WITH_NETSNMP)
BUILD_DEPENDS+= snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \
RUN_DEPENDS+=   snmpcheck:${PORTSDIR}/net-mgmt/net-snmp \

However, if you delete p5-SNMP_Session you'll get "Can't locate 
SNMP_util.pm in @INC" from MRTG.  Moreover, net-mgmnt/p5-SNMP-Util doesn't 
meet this dependency.

I have tried the following permutations of install order:

mrtg -> net-snmp -> nagios: okay
nagios -> mrtg -> (net-snmp already depend'd): okay
net-snmp -> nagios -> mrtg: okay
net-snmp -> mrtg -> nagios: testing now


main::(/usr/local/bin/mrtg:17): my @STARTARGS=($0, at ARGV);
    DB<1> c
Unknown SNMP var hrStorageUsed.5
   at /usr/local/bin/mrtg line 1980
   at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 1019
          SNMP_util::toOID('hrStorageUsed.5', 'hrStorageSize.5',
'sysUptime', 'sysName') called at
/usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 487
          SNMP_util::snmpget('pitbpa1cf at localhost::::::v4only',
'HASH(0x8da56e0)', 'hrStorageUsed.5', 'hrStorageSize.5', 'sysUptime',
'sysName') called at /usr/local/bin/mrtg line 1980
          main::getsnmparg('HASH(0x86bdd5c)', 'HASH(0x8da55c0)',
'HASH(0x8bb21c0)') called at /usr/local/bin/mrtg line 2259
          main::readtargets('HASH(0x86bdd5c)', 'ARRAY(0x8bbcdec)',
'HASH(0x8bb21c0)') called at /usr/local/bin/mrtg line 383
          main::main called at /usr/local/bin/mrtg line 145
Unknown SNMP var hrStorageSize.5
   at /usr/local/bin/mrtg line 1980
   at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 1019

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the mrtg mailing list