Solved

How to monitor SQUID hit ratio with MRTG (use cgi on apache)

Posted on 2010-08-30
9
1,820 Views
Last Modified: 2013-12-20
:   Hi everyone,

I have installed squid as cache server and also apache on that server. I am looking for an instruction for configuring squid and apache to enable me to monitor hit ratio of squid.
I installed squid 2.6 with snmp enabled option on CentOS linux.
I assume that I should configure apache and use a cgi to monitor the hit ratio in squid and also I should configure the squid to allow the apache to get information through snmp. actually I don't know to configure them and couldn't find a source to help for this configuration.

could anyone help me how to configure them.
0
Comment
Question by:kermanian
  • 5
  • 3
9 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 33564254
Did you configure squid to listen and respond on the SNMP?
Check the configuration for SNMP.
There is the port definition, the community and the access.
/etc/squid/squid.conf
acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow reaslsquid localhost
snmp_access deny all

You can replace localhost with the IP of the server where cacti is installed.
You can/should change the community from public to something else if you wish.

You could then setup cacti from cacti.net. and add the templates you need/want
http://docs.cacti.net/templates
You would need to import the template/s you want.
0
 
LVL 77

Expert Comment

by:arnold
ID: 33564656
0
 
LVL 1

Author Comment

by:kermanian
ID: 33580934
I have done the following activities:
1 - configure the squid for snmp
    acl snmppublic snmp_community public
    snmp_port 3401
    snmp_access allow reaslsquid localhost
    snmp_access deny all
2 - test the snmp by using the snmpwalk tool and it is working
3 - install httpd
4 - install mrtg

now I don't know how to configure cfg and show the result of mrtg on a graph
may you please help for this problem.
0
 
LVL 77

Expert Comment

by:arnold
ID: 33581255
You need to make sure the Acl and the snmp_access use the same acl name.
YOu also need to uncomment the binding for snmp

You need configure the OID in the target to poll for each .

did you run snmpwalk -v 2c -c public <ip>:3401 OID?

0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 1

Author Comment

by:kermanian
ID: 33614537
I have checked the snmpwalk and it is OK.
I have already configured the ACL and snmp_access

the problem is about setting the mrtg itself. and cfg file. I don't know how to configure the mrtg to present the data of snmp whoch is obtained from squid.

0
 
LVL 77

Expert Comment

by:arnold
ID: 33617447
http://www.visolve.com/squid/whitepapers/monitoringsquid.php
Squid MIB for reference:
http://www.oidview.com/mibs/3495/SQUID-MIB.html

You add the OID of the squid SNMP for requests, hits as the target in the mrtg.conf file for squid TThis will be the hit count.
Target[squid]: 1.3.6.1.4.1.3495.1.3.2.1.2:public@mydevice:3401
0
 
LVL 77

Expert Comment

by:arnold
ID: 33740578
All the information and references provided change the configuration of squid to respond to SNMP queries.
If you want to clarify what you are looking for, please do.  The answer to the question on how to configure squid for monitoring using SNMP is here.  Reference to the mrtg configuartion as well as an alternative cacti that could monitor other devices/application that you may have but have not considered.

0
 
LVL 1

Accepted Solution

by:
kermanian earned 0 total points
ID: 33751906
I could configure what I wanted with the help of all comments and some more search in internet. I have prepared the instruction and upload it.

hope it would be useful for everybody.

thanks for all helps and comments

Use-MRTG-to-Monitor-SQUID.pdf
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now