Status: Release Candidate - Production-ready with ongoing improvements
Overview
Proxy Monitor is a web application designed to work exclusively with the Squid-Cache proxy server and requires the Apache2 web server. It reads traffic information from Squid’saccess.log to generate detailed statistics and usage reports for the local network.
Use the tabs at the top of the dashboard to access each analysis module: Monitor (Squidmon), Traffic (LightSquid), Reports (SARG), Realtime (SqStat), Analyzer (SquidAnalyzer), and LogView.
System Requirements
| Component | Requirement |
|---|---|
| OS | Ubuntu 24.04.x |
| CPU | Intel Core i5/Xeon/AMD Ryzen 5 (≥ 3.0 GHz) |
| RAM | 16 GB |
| Storage | 2 GB SSD |
| Dependencies | Squid Cache v6.13, Apache v2.4.58, PHP 8.3.6 |
Installation
Download Project
Run Installation Script
Installation Options
The installation script supports multiple modes:Access URLs
Proxy Monitor
Main dashboard with all monitoring modules
Warning Portal
Quota limit notification portal
Modules
1. Monitor (Squidmon)
Squidmon provides detailed real-time traffic analysis and monitoring of your Squid proxy. It displays comprehensive statistics including blocked domains, blocked clients, traffic patterns, and ACL matching information.Key Features
- Top Blocked Domains: Shows most frequently blocked domains with request counts
- Top Blocked Clients: Displays client IPs with highest blocked request percentages
- Traffic by Client IP: Expandable view of all client traffic statistics
- ACL Filtering: Filter traffic by Blocked TLD, Blocked Sites, Blocked Patterns, Block IPv4, or Unknown ACL
- Search Functionality: Find specific IPs or domains quickly
- Time Range Reports: Last 24 Hours, Last 7 Days, Last 30 Days
- PDF Report Generation: Create detailed reports for auditing
- Blocked URLs Analysis: Granular details on blocked content per client
Configuration
Default ACL path is/etc/acl with these integrated lists:
Squid Configuration Example
ACLs must be declared in both Squidmon andsquid.conf:
squid.conf
Logrotate Configuration
Squidmon reads only the current
access.log file, not rotated files. Configure logrotate properly to maintain historical data.2. Traffic (LightSquid)
LightSquid provides fast traffic reports with per-user statistics and daily/monthly traffic analysis.Features
- General statistics with searchable tables
- Per-user bandwidth tracking
- Daily and monthly traffic reports
- Export to PDF, Excel (XLSX), and CSV formats
- Traffic search across historical data
- Bandwidth quota monitoring
First Run
If you see an error on first access, generate reports manually:Cron Job Configuration
Reports are generated every 10 minutes by default:User Management
Add Users Manually:Bandwidth Limits
Configure daily traffic limits inlightsquid.cfg:
Network Scanning
Discover devices on your network:3. BanData (Bandwidth Control)
BanData automatically blocks IPs that exceed daily, weekly, or monthly data quotas.Weekends are excluded from calculations. Limits must match those configured in LightSquid.
Cron Configuration
Data Limits
Default limits (configurable in/var/www/proxymon/tools/bandata.sh):
Check Banned IPs
Warning Portal
When users exceed quotas, they’re redirected to:4. Reports (SARG)
SARG (Squid Analysis Report Generator) provides detailed analysis of proxy traffic with comprehensive user activity reports.Features
- Global Reports: Aggregated statistics across all users
- Per-IP Reports: Individual user browsing activity
- Bandwidth Analysis: Traffic consumption and patterns
- Cache Efficiency: Hit rates and cache performance
- Connection Statistics: Request counts and connection frequency
Report Retention
SARG keeps the last 7 days of logs by default:5. Realtime (SqStat)
SqStat provides real-time monitoring of active Squid connections using the cachemgr protocol.Features
- Real-time active connection monitoring
- Auto-refresh (configurable: 5s, 10s, 30s, 60s)
- Light and dark theme support
- Current bandwidth usage
- Active user tracking
Theme Switching
6. Analyzer (SquidAnalyzer)
SquidAnalyzer provides graphical traffic statistics and usage trends.Features
- Real-time connection monitoring
- Active connections and users display
- Bandwidth speed calculation (current and average)
- IP to hostname resolution
- Connection duration tracking
- Data transfer size monitoring
- Auto-refresh capability
- Session-based analytics
Cron Configuration
7. LogView
Real-time Squid proxy log viewer with instant filtering and search capabilities.Features
- Real-time log parsing from
/var/log/squid/access.log - Instant full-text search
- Filter by cache code (TCP_HIT, TCP_MISS, TCP_DENIED, etc.)
- Filter by HTTP status (200, 206, 301, 302, 400, 403, 404, 500)
- Column sorting
- Configurable line count (500, 1000, 2000, 5000)
- Auto-refresh (1s, 3s, 5s, 10s, 30s)
- Light/dark theme
- Live polling with visual indicators
Configuration Locations
| Module | Configuration Path |
|---|---|
| Squidmon | Web interface: Config tab |
| LightSquid | /var/www/proxymon/lightsquid/lightsquid.cfg |
| SARG | /etc/sarg/sarg.conf |
| SqStat | /var/www/proxymon/sqstat/sqstat.class.php |
| BanData | /var/www/proxymon/tools/bandata.sh |
| Squid ACLs | /etc/acl/ |
Troubleshooting
No data in reports
No data in reports
- Verify Squid is running:
systemctl status squid - Check traffic is flowing through proxy
- Run LightSquid parser manually:
sudo /var/www/proxymon/lightsquid/lightparser.pl today - Verify
/var/log/squid/access.logcontains entries
SqStat shows connection error
SqStat shows connection error
- Wait 1-2 minutes after Squid restart/reload
- Press F5 to refresh the page
- Verify Squid cachemgr is accessible
- Check large ACL files aren’t delaying Squid startup
Squidmon search is slow
Squidmon search is slow
- Reduce the time range (use Last 24 Hours instead of 30 Days)
- Decrease max lines from 50,000 to 10,000
- Use “Reset to Default” button to restore optimal settings
- Consider log rotation settings
BanData not blocking users
BanData not blocking users
- Verify cron job is configured:
sudo crontab -l - Check ACL files exist:
ls -l /etc/acl/ban*.txt - Verify bandwidth limits are set correctly
- Check Squid configuration includes ban ACLs
- Review bandata script logs
Performance Tips
Optimize Log Analysis
- Use weekly/monthly log rotation
- Limit Squidmon to 24-hour windows
- Configure SARG retention to 7 days
- Clean old reports regularly
Reduce Resource Usage
- Adjust cron frequencies based on network size
- Use compressed log rotation
- Limit concurrent report generation
- Monitor Apache/PHP memory limits
Improve Search Speed
- Use Traffic Search for historical data
- Use Squidmon Search for real-time analysis
- Index frequently accessed reports
- Optimize ACL file sizes
Maintain Data Quality
- Regularly update realname.cfg
- Keep skipuser.cfg current
- Validate ACL rules periodically
- Monitor disk space for reports
License
GPL-3.0
Licensed under GNU General Public License v3.0
CC BY-SA 4.0
Documentation under Creative Commons Attribution-ShareAlike 4.0