Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-08-30
9
Medium Priority
?
1,937 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 80

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 80

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 80

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
 
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 80

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 80

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

971 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