[mrtg] Odd problem with squid mibs..

Kettler, Matt Matt.Kettler at edocorp.com
Wed Mar 26 20:59:58 CET 2008


I have a squid monitoring configuration, which I recently ported from
one server that uses mrtg-2.11.1 onto a server running mrtg-2.16.1.

 

On 2.11.1 I had no problems at all with this config, using the same
daemon_mode.cfg and everything.

 

I brought over my MRTG config, copied my squid mibfile, etc onto the new
server. My switch configs are different in that I regenerated them using
snmp v2 commands, due to the overflows.. however, even prior to that the
squid config wasn't working on the new box.

 

What's strange is, mrtg-2.116.1 appears to parse some of the variables
out of my squid mibfile when operated in daemon mode, but parses other
variables out of the same mibfile just fine.

 

If I run the config manually, i.e.:

 

env LANG=C /usr/bin/mrtg --logging /var/log/mrtg.log squid_server.cfg

 

All works fine.

 

If I load it with my daemon mode config, it starts to break.

 

My init script sets LANG=C near the top of the file, and passes mrtg:
the following parameters: /etc/mrtg/daemon_mode.cfg --logging
/var/log/mrtg.log

 

 

My daemon_mode.cfg looks like this (actual server names removed):

RunAsDaemon: Yes

Interval:    5

EnableIPv6: no

 

Include: /etc/mrtg/router.cfg

Include: /etc/mrtg/switch1.cfg

Include: /etc/mrtg/switch2.cfg

Include: /etc/mrtg/ciscoswitch_cpu.cfg

Include: /etc/mrtg/server1.cfg

Include: /etc/mrtg/squid_server.cfg

Include: /etc/mrtg/ups.cfg

...

 

Each config file has its own LoadMIBs, when needed. This particular
server is the 3rd in the config that uses LoadMIBs, and it's the only
one that loads the squid mib. None of my other configs have trouble
loading mib files that others aren't using. (ie: my ups config, which
comes later in daemon_mode.cfg)

 

In daemon mode this target works:

Target[squid_server-reqhitratios]:
cacheRequestHitRatio.5&cacheRequestHitRatio.60:community at server:3401

 

It graphs perfectly fine, with no errors.

 

In daemon mode this target causes an error:

Target[squid_server-hit]:
cacheHttpHits&cacheServerRequests:community at server:3401

 

In my mrtg.log I get:

 

2008-03-26 15:01:15 -- Unknown SNMP var cacheServerRequests

 at /usr/bin/mrtg line 2199

 

However, cacheServerRequests is declared in the same mibfile as
cacheRequestHitRatio.

 

My loadmib for squid_server.cfg looks like:

LoadMIBs: /usr/share/snmp/mibs/SQUID-MIB.txt,
/usr/share/snmp/mibs/UCD-SNMP-MIB.txt

 

And I can verify that variable in that same mibfile works properly with
snmpget:

 

# snmpget -m /usr/share/snmp/mibs/SQUID-MIB.txt -v1 -c community
squid_server:3401 cacheServerRequests

SQUID-MIB::cacheServerRequests.0 = INTEGER: 4715641

 

I can also verify that neither variable works without manually loading
the mibfile:

 

# snmpget  -v1 -c community squid_server:3401 cacheServerRequests

cacheServerRequests: Unknown Object Identifier (Sub-id not found: (top)
-> cacheServerRequests)

# snmpget  -v1 -c community squid_server:3401 cacheRequestHitRatio

cacheRequestHitRatio: Unknown Object Identifier (Sub-id not found: (top)
-> cacheRequestHitRatio)

 

 

What would cause a mibfile to work with snmpget, work with both MRTGs
manually, work in daemon mode on 2.11.1 but only partially work with
MRTG in Daemon mode in 2.16.1?  Is it unreasonable for me to have
multiple LoadMIB statements about?

 

I've also already verified no other mib file on the system declares
anything named cacheServerRequests:

 

# grep "cacheServerRequests" /usr/share/snmp/mibs/*

/usr/share/snmp/mibs/SQUID-MIB.txt:        cacheServerRequests
OBJECT-TYPE

#

 

 

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20080326/c98713d4/attachment-0001.html 


More information about the mrtg mailing list