Install Squidstats in FreebSD 9

Now I would like continue to install Squidstats in FreeBSD 9. I assumed you already success to install Lusca Head proxy server in previous post. And now Squidstats will gather and and report based on Lusca stuff or in other words 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.

Ins Squidstats you will get some graph reporting based, such as cache size, HIT efficiency, CPU utilization, and much more. All report presented as graph that make you easy to read and understand. Based on my experience, this is a good tool to monitor your Squid proxy server performance compare to others but it depends on you to decide which Squid monitoring tool will use on your server.

Actually there is no big difference between this article and older article about Squidstats. But I just keep my promise to write my activity when install new Lusca Head Proxy Server in my new server with FreeBSD 9. But I will add the configuration file to make you easier when you want to install Squidstats in FreeBSD 9.

Okay, let’s we start to install Squidstats in Free BSD 9, before you install Squidstats just ensure you have webserver in your server. At this moment we use Lighttpd instead of Apache webserver. So if you run Apache webserver, just ensure your apache configuration works on module CGI.

Install Lighttpd webserver and squidstats directly from internet by typing following command

proxy# pkg_add -rv lighttpd squidstats

Now, let’s configure the lighttpd webserver, just download 2 configuration file are lighttpd.conf and modules.conf than put in your lighttpd configuration directory

proxy# cd /usr/local/etc/lighttpd/
proxy# fetch http://simplyeko.com/newlusca/lighttpd.conf
proxy# fetch http://simplyeko.com/newlusca/modules.conf

Modify lighttpd.conf than go to end of line to replace the IP address webserver with your current existing your webserver IP address

# IPv4 listening socket
$SERVER["socket"] == "192.168.2.5:80" { }

Change 192.168.2.5 with your webserver IP address. Also don’t forget with IPV6 support, just disable the IPV6 support if you ignore it.
Put lighttpd_enable=”YES” in /etc/rc.conf before starting the lighttpd webserver, let’s start the webserver service

proxy# echo 'lighttpd_enable="YES"' >> /etc/rc.conf
proxy# service lighttpd start

Squidstats Configuration

Please follow some command below, ensure you type the command correctly especially if connected to directory.

proxy# mkdir -p /var/db/squidstats/graphs
proxy# mkdir -p /var/db/squidstats/rrd
proxy# chown www:wheel /var/db/squidstats/graphs
proxy# chown proxy:wheel /var/db/squidstats/rrd


proxy# ln -s /var/db/squidstats/graphs /usr/local/www/data/
proxy# ln -s /usr/local/www/cgi-bin/graph-summary.cgi /usr/local/www/data/graph-summary.cgi
proxy# su -m proxy -c "/usr/local/bin/squidstats.pl createdb"

if you find error due to unknown mib.txt file, you can download mib.txt by type following command

proxy# cd /usr/local/etc/squid/
proxy# fetch http;//simplyeko.com/newlusca/mib.txt

Okay now you can continue to configure the Squidstats

proxy# 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.

proxy# crontab -u proxy -e
*/5 * * * * /usr/local/bin/squidstats.pl gather 2 > /dev/null

Ensure your cron rule has been added to the crontab list, you can check by following command and get the result like below.

proxy# crontab -u proxy -l
*/5 * * * * /usr/local/bin/squidstats.pl gather 2 > /dev/null

now restart the crontab by following command;
# /etc/rc.d/cron restart

Now Squidstats runs in your Lusca head Proxy server in FreeBSD 9. If you would like to access the Squidstats just typing your webserver IP address such as http://yourIP_webserver_address/graph-summary.cgi. In there you will find the graph report about your Squid proxy performance.

If you follow the Squidstats configuration as the continuation of Lusca Head Proxy Server installation, you already have SNMP configuration in squid.conf. but if you have different way to install your Squid proxy server. Please ensure the configuration below already in your squid.conf to allow Squidstats capture and gather the data to presenting in webserver.

# Put this in squid.conf
acl snmp_host src 127.0.0.1
snmp_port 3401
acl snmppublic snmp_community public
snmp_access allow snmppublic snmp_host
snmp_access deny all

Hopefully this simple tutorial is useful for you. Please feel free to drop comment in comment box below if you have any suggestion and/or assistance about Squidstats installation in FreeBSD 9.

Comments

  1. Tutornya mantabs bos… tapi ini kayaknya untuk yg sudah prof… kalo ky sy yg masih nubie mas…

    Thanks, atas pembelajarannya mas.. salam sukses selalu

Speak Your Mind

*

Must Readclose