Networking

How to monitor Squid Proxy Server using Cacti in Ubuntu Server 13.04

August 31, 2013

[hmtad name=”Adsense Unit 3″ align=”floatright”]

Monitoring Squid With Cacti [Ubuntu Server 13.04]

 

What is cacti?

Cacti is a complete network graphing solution designed to harness the power of RRDTool‘s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.

What it will do?

It will generate graphs lots and lots of based on device types. We can add add various data sources templates and much more..

Setup Instructions:

SQUID Server:

First we need to make some changes to our squid server so as to allow SNMP monitoring and graphing in Cacti.

1. Install the following:

sudo apt-get install snmp
sudo apt-get install snmpd
sudo apt-get install snmp-mibs-downloader

2. Comment out mibs: in /etc/snmp/snmp.conf like this:

# As the snmp packages come without MIB files due to license reasons, loading
# of MIBs is disabled by default. If you added the MIBs you can reenable
# loaging them by commenting out the following line.
#mibs:

3. Add the following lines in /etc/snmp/snmpd.conf

proxy -v 1 -c public 127.0.0.1:3401 .1.3.6.1.4.1.3495.1
rocommunity public
syslocation "Home"
syscontact admin@jojo.net

4. Add the following lines in /etc/squid3/squid.conf

snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic all
snmp_incoming_address 0.0.0.0
snmp_outgoing_address 255.255.255.255

5. Restart the services:

service snmpd restart
service squid3 restart

6. Test SNMP Configuration by :

snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0

If everything’s right you will get following output:

SNMPv2-MIB::sysDescr.0 = STRING: Linux ubuntu 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:19:42 UTC 2013 i686

Cacti Server installation in Ubuntu Server 13.04

1. Install cacti:

apt-get install cacti

3. Go to your cacti console @ http://hostname/cacti

Default Username:Password = admin:admin
4. Login to the cacti console

5. Then we’ll install the template for squid from https://copy.com/o4CTmPUN4Z4eOH1x

6. Click Import Templates -> Browse for the templates -> Import

7 Go to Devices -> Add

8.Change the following:

Device : Give a description for your device.
Hostname : Put in Squid IP/HostnameTemplate : NLANR Squid Proxy

Leave all other setting to their default.

9. Then click on Create Graphs for this Host.

10. Select Graph Template Name which you want to generate -> Create

11. Goto Graph Trees -> Add -> Give a name -> Add Tree Item

12. Tree item type – host -> Select a host from the list -> Create

 

13. That’s it. Your graph will be generated and you can view it in the Graph tab.