Re: Fwd: [squid-users] Squid, SNMP and MRTG

From: s f <sf@dont-contact.us>
Date: Sat, 22 Dec 2007 12:57:55 +0545

Yes you dont need to use cfgmaker to monitor squid.
There is a link to mrtg-squid.cfg file here http://chrismiles.info/unix/mrtg/
Also a little tutorial at
http://techspalace.blogspot.com/2007/12/mrtg-for-squid.html

Regards,
Roshan Karki

On 12/21/07, Tek Bahadur Limbu <teklimbu@wlink.com.np> wrote:
> Hi Indunil,
>
> You don't use the cfgmaker with Squid as you normally do with Linux
> network interfaces.
>
> You need the SNMP OIDs for graphing Squid MRTG.
>
> Put something like the below in your mrtg.cfg file:
>
>
> Target[1cacheServerRequests]:
> cacheServerRequests&cacheServerRequests:public@localhost:3001
> MaxBytes[1cacheServerRequests]: 10000000
> Title[1cacheServerRequests]: Server Requests @ cacheproxy88
> Options[1cacheServerRequests]: nopercent
> PageTop[1cacheServerRequests]: <h1>Server Requests @ cacheproxy88</h1>
> YLegend[1cacheServerRequests]: requests/sec
> ShortLegend[1cacheServerRequests]: req/s
> LegendI[1cacheServerRequests]: Requests&nbsp;
> LegendO[1cacheServerRequests]:
> Legend1[1cacheServerRequests]: Requests
> Legend2[1cacheServerRequests]:
>
>
> Target[2cacheHttpInOutKb]:
> cacheHttpInKb&cacheHttpOutKb:public@localhost:3001 * 1024 * 8
> MaxBytes[2cacheHttpInOutKb]: 1000000000
> Title[2cacheHttpInOutKb]: HTTP In/Out Traffic @ cacheproxy88
> Options[2cacheHttpInOutKb]: nopercent
> PageTop[2cacheHttpInOutKb]: <h1>HTTP In/Out Traffic @ cacheproxy88</h1>
> YLegend[2cacheHttpInOutKb]: Bits/second
> ShortLegend[2cacheHttpInOutKb]: Bits/s
> LegendI[2cacheHttpInOutKb]: HTTP In&nbsp;
> LegendO[2cacheHttpInOutKb]: HTTP Out&nbsp;
> Legend1[2cacheHttpInOutKb]: HTTP In
> Legend2[2cacheHttpInOutKb]: HTTP Out
>
>
> The most important thing to note is in the Target parameter.
>
>
> Check out the following site for more help and information about SNMP
> and Squid:
>
> http://www.onlamp.com/pub/a/onlamp/2004/03/25/squid.html
>
> Thanking you...
>
>
>
> Indunil Jayasooriya wrote:
> > Hi again,
> >
> > before running this command pl make the mrtg working directory like
> > "/var/www/mrtg"
> >
> > Yes, I made it. pls see below
> >
> > [root@mail ~]# mkdir /var/www/mrtgnew
> >
> > after making the directory run this command
> >
> > cfgmaker --global 'WorkDir: /mrtg_working_dir_path/' --output
> > /etc/mrtg/mrtg.cfg public@localhost
> >
> > yes , I did it. pls see below
> >
> > [root@mail ~]# cfgmaker --global 'WorkDir: /var/www/mrtgnew' --output
> > /etc/mrtg/mrtgnew.cfg public@localhost
> > It worked.
> > then, I checked my /etc/mrtg/mrtgnew.cfg . it is a traditinal mrtg.cfg file.
> >
> >
> > after running this make a entry in /etc/mrtg/mrtg.cfg
> > LoadMIBs: /etc/squid/mib.txt
> > Yes, I added it.
> >
> > this is my full /etc/mrtg/mrtgnew.cfg
> >
> > [root@mail mrtgnew]# cat /etc/mrtg/mrtgnew.cfg
> > # Created by
> > # /usr/bin/cfgmaker --global 'WorkDir: /var/www/mrtgnew' --output
> > /etc/mrtg/mrtgnew.cfg public@localhost
> >
> >
> > ### Global Config Options
> >
> > # for UNIX
> > # WorkDir: /home/http/mrtg
> >
> > # or for NT
> > # WorkDir: c:\mrtgdata
> >
> > ### Global Defaults
> >
> > # to get bits instead of bytes and graphs growing to the right
> > # Options[_]: growright, bits
> >
> > EnableIPv6: no
> > WorkDir: /var/www/mrtgnew
> > LoadMIBs: /etc/squid/mib.txt
> > ######################################################################
> > # System: mail.douglas.lk
> > # Description: Linux mail.douglas.lk 2.6.9-55.EL #1 Fri Apr 20
> > 16:35:59 EDT 2007 i686
> > # Contact: mrtg@eopensys.com
> > # Location: Unknown
> > ######################################################################
> >
> >
> > ### Interface 1 >> Descr: 'lo' | Name: '' | Ip: '127.0.0.1' | Eth: '' ###
> > ### The following interface is commented out because:
> > ### * it is a Software Loopback interface
> > #
> > # Target[localhost_1]: 1:public@localhost:
> > # SetEnv[localhost_1]: MRTG_INT_IP="127.0.0.1" MRTG_INT_DESCR="lo"
> > # MaxBytes[localhost_1]: 1250000
> > # Title[localhost_1]: Traffic Analysis for 1 -- mail.douglas.lk
> > # PageTop[localhost_1]: <H1>Traffic Analysis for 1 -- mail.douglas.lk</H1>
> > # <TABLE>
> > # <TR><TD>System:</TD> <TD>mail.douglas.lk in Unknown</TD></TR>
> > # <TR><TD>Maintainer:</TD> <TD>mrtg@eopensys.com</TD></TR>
> > # <TR><TD>Description:</TD><TD>lo </TD></TR>
> > # <TR><TD>ifType:</TD> <TD>softwareLoopback (24)</TD></TR>
> > # <TR><TD>ifName:</TD> <TD></TD></TR>
> > # <TR><TD>Max Speed:</TD> <TD>1250.0 kBytes/s</TD></TR>
> > # <TR><TD>Ip:</TD> <TD>127.0.0.1 (localhost)</TD></TR>
> > # </TABLE>
> >
> >
> > ### Interface 2 >> Descr: 'eth0' | Name: '' | Ip: '192.168.122.54' |
> > Eth: '00-11-5b-78-db-ad' ###### The following interface is commented
> > out because:
> > ### * it is operationally DOWN
> > #
> > # Target[localhost_2]: 2:public@localhost:
> > # SetEnv[localhost_2]: MRTG_INT_IP="192.168.122.54" MRTG_INT_DESCR="eth0"
> > # MaxBytes[localhost_2]: 1250000
> > # Title[localhost_2]: Traffic Analysis for 2 -- mail.douglas.lk
> > # PageTop[localhost_2]: <H1>Traffic Analysis for 2 -- mail.douglas.lk</H1>
> > # <TABLE>
> > # <TR><TD>System:</TD> <TD>mail.douglas.lk in Unknown</TD></TR>
> > # <TR><TD>Maintainer:</TD> <TD>mrtg@eopensys.com</TD></TR>
> > # <TR><TD>Description:</TD><TD>eth0 </TD></TR>
> > # <TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
> > # <TR><TD>ifName:</TD> <TD></TD></TR>
> > # <TR><TD>Max Speed:</TD> <TD>1250.0 kBytes/s</TD></TR>
> > # <TR><TD>Ip:</TD> <TD>192.168.122.54 ()</TD></TR>
> > # </TABLE>
> >
> >
> > ### Interface 3 >> Descr: 'eth1' | Name: '' | Ip: '192.168.4.6' | Eth:
> > '00-50-ba-83-41-d9' ###
> >
> > Target[localhost_3]: 3:public@localhost:
> > SetEnv[localhost_3]: MRTG_INT_IP="192.168.4.6" MRTG_INT_DESCR="eth1"
> > MaxBytes[localhost_3]: 12500000
> > Title[localhost_3]: Traffic Analysis for 3 -- mail.douglas.lk
> > PageTop[localhost_3]: <H1>Traffic Analysis for 3 -- mail.douglas.lk</H1>
> > <TABLE>
> > <TR><TD>System:</TD> <TD>mail.douglas.lk in Unknown</TD></TR>
> > <TR><TD>Maintainer:</TD> <TD>mrtg@eopensys.com</TD></TR>
> > <TR><TD>Description:</TD><TD>eth1 </TD></TR>
> > <TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR>
> > <TR><TD>ifName:</TD> <TD></TD></TR>
> > <TR><TD>Max Speed:</TD> <TD>12.5 MBytes/s</TD></TR>
> > <TR><TD>Ip:</TD> <TD>192.168.4.6 (mail.douglas.lk)</TD></TR>
> > </TABLE>
> >
> >
> > ### Interface 4 >> Descr: 'sit0' | Name: '' | Ip: '' | Eth:
> > '00-00-00-00-41-d9' ###
> > ### The following interface is commented out because:
> > ### * it is administratively DOWN
> > ### * it is operationally DOWN
> > ### * has a speed of 0 which makes no sense
> > #
> > # Target[localhost_4]: 4:public@localhost:
> > # SetEnv[localhost_4]: MRTG_INT_IP="" MRTG_INT_DESCR="sit0"
> > # MaxBytes[localhost_4]: 0
> > # Title[localhost_4]: Traffic Analysis for 4 -- mail.douglas.lk
> > # PageTop[localhost_4]: <H1>Traffic Analysis for 4 -- mail.douglas.lk</H1>
> > # <TABLE>
> > # <TR><TD>System:</TD> <TD>mail.douglas.lk in Unknown</TD></TR>
> > # <TR><TD>Maintainer:</TD> <TD>mrtg@eopensys.com</TD></TR>
> > # <TR><TD>Description:</TD><TD>sit0 </TD></TR>
> > # <TR><TD>ifType:</TD> <TD>Encapsulation Interface (131)</TD></TR>
> > # <TR><TD>ifName:</TD> <TD></TD></TR>
> > # <TR><TD>Max Speed:</TD> <TD>0.0 Bytes/s</TD></TR>
> > # </TABLE>
> >
> >
> > and here is my /etc/snmp/snmpd.conf file
> >
> > [root@mail mrtgnew]# cat /etc/snmp/snmpd.conf
> > com2sec local localhost public
> > com2sec mynetwork 192.1.54.0/24 public
> > com2sec mynetwork 192.168.9.0/24 public
> >
> > group MyRWGroup v1 local
> > group MyROGroup v1 mynetwork
> > group MyRWGroup v1 otherv3user
> >
> > view all included .1 80
> >
> > access MyROGroup "" any noauth exact all none none
> > access MyRWGroup "" any noauth exact all all all
> >
> > syscontact mrtg@eopensys.com
> >
> > then , I ran below command. it worked too.
> >
> > [root@mail mrtgnew]# indexmaker
> > --output=/var/www/mrtgnew/indexnew.html /etc/mrtg/mrtgnew.cfg
> >
> > then, I ran below commands 3 times.
> >
> > [root@mail mrtgnew]# indexmaker
> > --output=/var/www/mrtgnew/indexnew.html /etc/mrtg/mrtgnew.cfg
> >
> > [root@mail mrtgnew]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtgnew.cfg
> > Rateup WARNING: /usr/bin/rateup could not read the primary log file
> > for localhost_3
> > Rateup WARNING: /usr/bin/rateup The backup log file for localhost_3
> > was invalid as well
> > Rateup WARNING: /usr/bin/rateup Can't remove localhost_3.old updating log file
> > Rateup WARNING: /usr/bin/rateup Can't rename localhost_3.log to
> > localhost_3.old updating log file[root@mail mrtgnew]# env LANG=C
> > /usr/bin/mrtg /etc/mrtg/mrtgnew.cfg
> > Rateup WARNING: /usr/bin/rateup Can't remove localhost_3.old updating log file
> > [root@mail mrtgnew]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtgnew.cfg
> >
> >
> > But, I get traditional mrtg page. Nothing related to squid.
> >
> > No LoadMIBs: /etc/squid/mib.txt file hase been loaed to that index.html page?
> >
> > HELP NEEDED again?
> >
> >
> >
>
>
> --
>
> With best regards and good wishes,
>
> Yours sincerely,
>
> Tek Bahadur Limbu
>
> System Administrator
>
> (TAG/TDG Group)
> Jwl Systems Department
>
> Worldlink Communications Pvt. Ltd.
>
> Jawalakhel, Nepal
>
> http://www.wlink.com.np
>
> http://teklimbu.wordpress.com
>
Received on Sat Dec 22 2007 - 00:12:58 MST

This archive was generated by hypermail pre-2.1.9 : Tue Jan 01 2008 - 12:00:02 MST