Solved

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

Posted on 2010-08-30
9
1,804 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 76

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 76

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 76

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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 76

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 76

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
The viewer will learn how to dynamically set the form action using jQuery.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 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

12 Experts available now in Live!

Get 1:1 Help Now