SquidStats
SquidStats A modern tool for parsing and analyzing Squid logs, providing a sleek and user-friendly dashboard to visualize real-time connection data. This project helps network administrators monitor and manage Squid proxy connections effectively, including quota management and usage control.
Install / Use
/learn @kaelthasmanu/SquidStatsREADME
About the Project
A modern tool for parsing and analyzing Squid logs, providing a sleek and user-friendly dashboard to visualize real-time connection data. This project helps network administrators monitor and manage Squid proxy connections effectively.
You can view the example here.
<div align="center"> <img src="https://github.com/kaelthasmanu/SquidStats/blob/main/assets/photo_2025-03-16_10-33-06.jpg" alt="fig1" width="65%" style="min-width: 300px; max-width: 800px; border: 1px solid #ddd; border-radius: 6px;"/> </div> <div align="center"> <img src="https://github.com/kaelthasmanu/SquidStats/blob/main/assets/photo_2025-04-04_15-45-33.jpg" alt="fig2" width="65%" style="min-width: 300px; max-width: 800px; border: 1px solid #ddd; border-radius: 6px;"/> </div> <div align="center"> <img src="https://github.com/kaelthasmanu/SquidStats/blob/main/assets/photo_2025-04-21_02-13-38.jpg" alt="fig3" width="65%" style="min-width: 300px; max-width: 800px; border: 1px solid #ddd; border-radius: 6px;"/> </div>Goals of this project :
- Real-time Log Parsing: Parses active Squid connections and displays detailed information.
- User Monitoring: Identifies connections by username, URI, and log type.
- Metrics Overview:
- Total read and written data for each connection.
- Number of requests per connection.
- Delay pool usage.
- Interactive Dashboard: Clean interface for easy data interpretation.
- Squid Cache Statistics:
- Stored entries.
- Used and free capacity
- Maximum and current cache size
- Disk space and inode usage
- Age of cached objects
- Logs Users:
- User activity monitoring 👥
- Beautiful visualizations 📊
- Advanced filtering & search 🔍
- Paginated results 📄
- Top Graphs:
- Top 20 Users Activity
- Top 20 Users Data Usage
- Total Users
- Total Transmitted Data
- Total Request
- And More...
- Quota System:
- Quota per users
- Quota per group
- And More
<a href="#readme-top"><img align="right" border="0" src="https://github.com/kaelthasmanu/SquidStats/blob/main/assets/up_arrow.png" width="22" ></a>
<!-- GETTING STARTED -->Getting Started
The entire installation process in more detail can be found here.
Prerequisites
- Python 3.10+
- Squid proxy server
apt install git python3 python3-pip python3-venv libmariadb-dev curl
Note: If your Squid proxy does not use user authentication (i.e., you do not use login or password for clients), you can keep the default log format that comes with Squid. The detailed format below is only required for full compatibility with user-based reports.
- ⚠️ !!Important (Only work before version 7.1) ⚠️ For compatibility with user logs, use this format in /etc/squid/squid.conf:
logformat detailed \
"%ts.%03tu %>a %ui %un [%tl] \"%rm %ru HTTP/%rv\" %>Hs %<st %rm %ru %>a %mt %<a %<rm %Ss/%Sh %<st
access_log /var/log/squid/access.log detailed
🔧 Cache Manager Configuration (Critical for SquidStats)
SquidStats requires proper Cache Manager configuration to function correctly. Please follow the official Squid Cache Manager documentation for complete setup.
Essential Configuration Steps:
-
Configure Cache Manager Access Controls in
/etc/squid/squid.conf:# Allow localhost access to cache manager acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 # Basic cache manager access http_access allow localhost manager http_access deny manager -
Configure Remote Access (if SquidStats runs on different server):
# Replace 192.168.1.100 with your SquidStats server IP acl managerAdmin src 192.168.1.100 http_access allow managerAdmin manager -
Verify Cache Manager is Working:
# Test cache manager access curl http://127.
