Cacti/Squid Setup
From Gentoo Linux Wiki
Contents |
[edit] Getting Started
To graph your squid proxy on cacti you will first need to install a template for your squid graphs. One helpful user posted a set of templates for squid here: http://forums.cacti.net/about3158.html
However if you follow the instructions laid out they will not work because in cacti 0.8.6 some changes were made that did not allow you to use a host that does not deliver a proper hostname and uptime (squid does not provide these).
So to get started install everything as laid out in the README file of that teamplate set. When you reach the section for adding a device stop, that is where we make some changes.
[edit] Using your snmpd as a proxy
This section assumes you have installed Cacti/SNMP_host_setup, if you have not done so, do so now.
Alter your /etc/snmp/snmpd.conf to include the following line :
| File: /etc/snmp/snmpd.conf |
... proxy -m /usr/share/squid/mib.txt -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1 '''OR''' proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1 ... I found I could not get this to work without the following line in smtpd.conf ... view system included .1.3.6.1.4.1.3495.1 ... |
Please check for the location of your mib.txt file it may be different than listed
Alter your /etc/squid/squid.conf to include the following lines :
| File: /etc/squid/squid.conf |
###################### # Cacti/Squid Stats ##################### acl snmpcommunity snmp_community public snmp_port 3401 snmp_access allow snmpcommunity localhost snmp_access deny all |
If you search for snmp it will be obvious where to put these lines, this setup is valid for localhost not any remote host
This will proxy your squid's snmp traffic and allow for it to transfer proper hostname and uptime information.
[edit] Continuing
Continue following the README provided by the package above, when adding the device make sure to use the snmpd port and NOT your squid's snmp port. From this point you should have no trouble adding graphs and other squid data to graphs.
NB: You may need to do one more step to the data queries in order for the graphs to be filled. Go to Console -> Data Queries, and choose one of the two Squid Web Cache entries. Then for each of the associated graph templates, go into the entry and tick the checkbox next to the data source, and click save. This seems to enable data collection on that measure - for some reason it's disabled by default.
[edit] Troubleshooting
[edit] Testing Squid
snmpwalk -c public -v1 127.0.0.1:3401 .1.3.6.1.4.1.3495.1
if this returns a whole bunch of lines, squid is properly providing snmp
[edit] Testing your tunnel
snmpwalk -c public -v1 127.0.0.1:161 .1.3.6.1.4.1.3495.1
if this returns a whole bunch of lines, snmpd is properly proxy'ing the squid connection
[edit] How it looks
[edit] More
- Cacti
- Cacti/Installation
- Cacti/SNMP host setup
- Cacti/Squid Setup
- Cacti/Hacking prevention
- http://cacti.net

