This is a simple tutorial how to install squidstats on FreeBSD Lusca Head Proxy Server that already running for production. The squidstats is a squid monitoring tool which present by displaying the graph data through web browser. The purpose from this small application is to help us to know the squid proxy server performance since it has already built in with time to time reporting.
However, there are many squid monitoring tools for squid, but based on my experience the squidstats is one of the best squid monitoring tools. So, let see below how I install and configure squidtstats on FreeBSD.
- Install squidstats, this is an easy part
# pkg_add -rv squidstats
Once finish, configure the squidstats. However, we need to ensure the web server -for this case I’m using lighttpd instead of Apache22 as default webserver since the lighttpd is light and powerful. I will discuss it later. Let’s go to squidstats.
- Configure squidstats
# mkdir -p /var/db/squidstats/graphs
# mkdir -p /var/db/squidstats/rrd
# chown www:wheel /var/db/squidstats/graphs
# chown proxy:wheel /var/db/squidstats/rrd
# ln -s /var/db/squidstats/graphs /usr/local/www/data/
# ln -s /usr/local/www/cgi-bin/graph-summary.cgi /usr/local/www/data/graph-summary.cgi
# su -m proxy -c “/usr/local/bin/squidstats.pl createdb”
# su -m proxy -c “/usr/local/bin/squidstats.pl gather 2″
Done. the configuration has already finished and ready to capture the squid data to present it through web server. To ensure the squidstat running properly, add the cron job for squidstats, type following command.
# crontab -u proxy -e
*/5 * * * * /usr/local/bin/squidstats.pl gather 2 > /dev/null
now restart the crontab by following command;
# /etc/rc.d/cron restart
Now, test the squidstat by open with your browser and type in address bar http://your-ip/graph-summary.cgi
Note: the squid.conf on the previous post has already included with snmp support for squidstat purpose, but if you use other squid.conf, just ensure the following parameter included on your squid.conf
# Put this in squid.conf
acl snmp_host src 127.0.0.1
acl snmppublic snmp_community public
snmp_access allow snmppublic snmp_host
snmp_access deny all