<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Courier New;color: #000000;font-size: 10pt;">
I looked at the IMPORTS line in the squid 3.1.8 MIB file and there is nothing there of concern. It is acting more like the MIB file couldn't be read at all. Check the permissions on the file and its directory path. Judging from your example, you're running
'snmpget' as root. Try running 'snmpget' under the same ID as you're running mrtg.<br>
<br>
Here's a small perl script that can be used to test the MIB parser:<br>
<br>
#!/usr/bin/perl<br>
# change the following line to point to your MRTG library directory<br>
use lib qw(/usr/local/etc/mrtg/lib/mrtg2)<br>
use SNMP_util;<br>
<br>
$SNMP_util::Debug = 1;<br>
foreach $arg (@ARGV) {<br>
$cnt = SNMP_util::snmpMIB_to_OID($arg);<br>
print "Loaded $cnt OIDs\n";<br>
}<br>
<br>
I ran the script with the path to the squid 3.1.8 MIB file as its only argument.<br>
It returned a list of textual strings to OID numbers and the line "Loaded 114 OIDs".<br>
<br>
Mike Mitchell<br>
<br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF405557"><font size="2" color="#000000" face="Tahoma"><b>From:</b> mrtg-bounces+mike.mitchell=sas.com@lists.oetiker.ch [mrtg-bounces+mike.mitchell=sas.com@lists.oetiker.ch] on behalf of Babu C [babscontact@rediffmail.com]<br>
<b>Sent:</b> Wednesday, October 06, 2010 6:00 AM<br>
<b>To:</b> mrtg@lists.oetiker.ch<br>
<b>Subject:</b> [mrtg] MRTG not honouring mib file<br>
</font><br>
</div>
<div></div>
<div>Hi List,<br>
As I suspect my issue is something to do with mrtg I am posting it <br>
here, I have upgraded the squid box to 3.1.8 and everything is working <br>
fine except the graph part with mrtg.<br>
<br>
Details of system as follows<br>
OS FreeBSD : 8.1 <br>
Squid : 3.1.8<br>
MRTG : mrtg-2.16.4<br>
<br>
My mrtg.cfg is as below<br>
<br>
LoadMIBs: /usr/local/etc/mrtg/squid.mib<br>
EnableIPv6: no<br>
WorkDir: /usr/local/www/apache22/data<br>
Options[_]: bits,growright<br>
<br>
Target[proxy-hit]: <br>
cacheHttpHits&cacheServerRequests:public@127.0.0.1:3401<br>
MaxBytes[proxy-hit]: 100000<br>
Title[proxy-hit]: HTTP Hits<br>
Suppress[proxy-hit]: y<br>
LegendI[proxy-hit]: HTTP hits<br>
LegendO[proxy-hit]: HTTP requests<br>
Legend1[proxy-hit]: HTTP hits<br>
Legend2[proxy-hit]: HTTP requests<br>
YLegend[proxy-hit]: perminute<br>
ShortLegend[proxy-hit]: req/min<br>
Options[proxy-hit]: nopercent, perminute, dorelpercent, unknaszero,<br>
growright, pngdate<br>
#PNGTitle[proxy-hit]: Proxy Hits<br>
<br>
Target[proxy-srvkbinout]: <br>
cacheServerInKb&cacheServerOutKb:public@127.0.0.1:3401<br>
MaxBytes[proxy-srvkbinout]: 76800<br>
Title[proxy-srvkbinout]: Cache Server Traffic In/Out<br>
Suppress[proxy-srvkbinout]: y<br>
LegendI[proxy-srvkbinout]: Traffic In<br>
LegendO[proxy-srvkbinout]: Traffic Out<br>
Legend1[proxy-srvkbinout]: Traffic In<br>
Legend2[proxy-srvkbinout]: Traffic Out<br>
YLegend[proxy-srvkbinout]: per minute<br>
ShortLegend[proxy-srvkbinout]: b/min<br>
kMG[proxy-srvkbinout]: k,M,G,T<br>
kilo[proxy-srvkbinout]: 1024<br>
Options[proxy-srvkbinout]: nopercent, perminute, unknaszero, <br>
growright, pngdate<br>
<br>
I have verified that squid snmp is working through the following <br>
command<br>
<br>
#snmpget -On -m /usr/local/etc/mrtg/squid.mib -v 2c -c public <br>
127.0.0.1:3401 cacheHttpHits cacheServerRequests cacheServerInKb <br>
cacheServerOutKb cacheUptime CacheSoftware cacheVersionId<br>
<br>
This gives me results without any errors so snmp part of squid is <br>
working fine I think<br>
Now when I run mrtg I could see the following errors in mrtg.log file<br>
<br>
010-10-04 12:37:33 -- Started mrtg with config <br>
'/usr/local/etc/mrtg/mrtg.cfg'<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheHttpHits<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheServerRequests<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheUptime<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheSoftware<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheVersionId<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Use of uninitialized value $ret[-2] in<br>
concatenation (.) or string at /usr/local/bin/mrtg line 2261.<br>
2010-10-04 12:37:33 -- Use of uninitialized value $ret[-1] in<br>
concatenation (.) or string at /usr/local/bin/mrtg line 2261.<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheServerInKb<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheServerOutKb<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheUptime<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheSoftware<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Unknown SNMP var cacheVersionId<br>
at /usr/local/bin/mrtg line 2242<br>
2010-10-04 12:37:33 -- Use of uninitialized value $ret[-2] in<br>
concatenation (.) or string at /usr/local/bin/mrtg line 2261.<br>
2010-10-04 12:37:33 -- Use of uninitialized value $ret[-1] in<br>
concatenation (.) or string at /usr/local/bin/mrtg line 2261.<br>
2010-10-04 12:37:33 -- 2010-10-04 12:37:33: ERROR:<br>
Target[proxy-hit][_IN_] ' $target->[0]{$mode} ' did not eval into<br>
defined data<br>
2010-10-04 12:37:33 -- 2010-10-04 12:37:33: ERROR:<br>
Target[proxy-hit][_OUT_] ' $target->[0]{$mode} ' did not eval into<br>
defined data<br>
2010-10-04 12:37:33 -- 2010-10-04 12:37:33: ERROR:<br>
Target[proxy-srvkbinout][_IN_] ' $target->[1]{$mode} ' did not eval<br>
into defined data<br>
2010-10-04 12:37:33 -- 2010-10-04 12:37:33: ERROR:<br>
Target[proxy-srvkbinout][_OUT_] ' $target->[1]{$mode} ' did not eval<br>
into defined data<br>
<br>
All I could make out from these error was mrtg not reading squid.mib <br>
file. Am I right?<br>
Now I am stuck and I suspect a broken mrtg? or did I go wrong <br>
somewhere? Do kindly let me know what went wrong and how to proceed<br>
further.<br>
Thanx in advance<br>
Babs<br>
<table style="font-family: Verdana; font-size: 11px; line-height: 15px;" width="644" border="0" cellpadding="0" cellspacing="0" height="57">
<tbody>
<tr>
<td><a href="http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?" target="_blank"><img></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>