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

[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.

Enjoyed this post? Share it!

 
  • Dowson Littlerock

    What else can Cacti do? i have a tool Anturis which can monitor not only servers, but networks as well. Are there any additional features?

  • moh alomar

    actually I tried same above code given

    10/10/2013 11:40:01 AM – SYSTEM STATS: Time:0.1342 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSourc
    es:58 RRDsProcessed:55
    10/10/2013 11:45:01 AM – SYSTEM STATS: Time:0.1378 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSourc
    es:58 RRDsProcessed:55
    10/10/2013 11:50:01 AM – SYSTEM STATS: Time:0.1398 Method:cmd.php Processes:1 Threads:N/A Hosts:4 HostsPerProcess:4 DataSourc
    es:58 RRDsProcessed:55

    Centos 6 cacti-0.8.8b-3.el6.noarch

    cacti install on same server that have squid is this issue ?

    snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0
    SNMPv2-SMI::enterprises.3495.1.1.1.0 = INTEGER: 140
    SNMPv2-SMI::enterprises.3495.1.1.2.0 = INTEGER: 0
    SNMPv2-SMI::enterprises.3495.1.1.3.0 = Timeticks: (106578) 0:17:45.78
    SNMPv2-SMI::enterprises.3495.1.2.1.0 = STRING: “root”
    SNMPv2-SMI::enterprises.3495.1.2.2.0 = STRING: “squid”
    SNMPv2-SMI::enterprises.3495.1.2.3.0 = STRING: “3.1.10”
    SNMPv2-SMI::enterprises.3495.1.2.4.0 = STRING: “ALL,1”
    SNMPv2-SMI::enterprises.3495.1.2.5.1.0 = INTEGER: 256
    SNMPv2-SMI::enterprises.3495.1.2.5.2.0 = INTEGER: 0
    SNMPv2-SMI::enterprises.3495.1.2.5.3.0 = INTEGER: 95
    SNMPv2-SMI::enterprises.3495.1.2.5.4.0 = INTEGER: 90

    • moh alomar

      here is my problem no result showen

  • satish

    Thanks dear…its working…

  • Amirmohsen Bayat

    hi Dear
    this link not working

    https://copy.com/o4CTmPUN4Z4eOH1x