SkillAgentSearch skills...

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/SquidStats

README

<h1 align="center"> <img alt="SQUIDSTAT logo" src="https://github.com/kaelthasmanu/SquidStats/blob/main/assets/squidstats.webp" width="300px"/><br/> <strong>The definitive analysis for your proxy</strong> </h1> <div align="center"> <!-- Banderas --> <a href="https://github.com/kaelthasmanu/SquidStats/blob/master/README_es.md"> <img height="20px" src="https://img.shields.io/badge/ES-flag.svg?color=555555&style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3NTAgNTAwIj4NCjxwYXRoIGZpbGw9IiNjNjBiMWUiIGQ9Im0wLDBoNzUwdjUwMGgtNzUweiIvPg0KPHBhdGggZmlsbD0iI2ZmYzQwMCIgZD0ibTAsMTI1aDc1MHYyNTBoLTc1MHoiLz4NCjwvc3ZnPg0K"> </a> <a href="https://github.com/kaelthasmanu/SquidStats/blob/master/README.md"> <img height="20px" src="https://img.shields.io/badge/EN-flag.svg?color=555555&style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNjAgMzAiIGhlaWdodD0iNjAwIj4NCjxkZWZzPg0KPGNsaXBQYXRoIGlkPSJ0Ij4NCjxwYXRoIGQ9Im0zMCwxNWgzMHYxNXp2MTVoLTMwemgtMzB2LTE1enYtMTVoMzB6Ii8+DQo8L2NsaXBQYXRoPg0KPC9kZWZzPg0KPHBhdGggZmlsbD0iIzAwMjQ3ZCIgZD0ibTAsMHYzMGg2MHYtMzB6Ii8+DQo8cGF0aCBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNiIgZD0ibTAsMGw2MCwzMG0wLTMwbC02MCwzMCIvPg0KPHBhdGggc3Ryb2tlPSIjY2YxNDJiIiBzdHJva2Utd2lkdGg9IjQiIGQ9Im0wLDBsNjAsMzBtMC0zMGwtNjAsMzAiIGNsaXAtcGF0aD0idXJsKCN0KSIvPg0KPHBhdGggc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEwIiBkPSJtMzAsMHYzMG0tMzAtMTVoNjAiLz4NCjxwYXRoIHN0cm9rZT0iI2NmMTQyYiIgc3Ryb2tlLXdpZHRoPSI2IiBkPSJtMzAsMHYzMG0tMzAtMTVoNjAiLz4NCjwvc3ZnPg0K"> </a> </div> <a name="readme-top"></a> <h1 align="center">

GitHub repo size GitHub License GitHub stars GitHub forks GitHub top language GitHub contributors Watchers

</h1> <h4 align="center">:star: Give me one star — it will motivate me to keep improving it!!</h4> <!-- TABLE OF CONTENTS --> <details> <summary>Table of contents</summary> <ol> <li> <a href="#about-the-project">About the Project</a> <ul> <li><a href="#goals-of-this-project-">Goals of this project</a></li> </ul> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#prerequisites">Prerequisites</a></li> <li> <a href="#installation-script">Installation Script</a> <ul> <li><a href="#installation-options">Installation Options</a></li> <li><a href="#️-blacklist-configuration">Blacklist Configuration</a></li> </ul> </li> <li> <a href="#installation-manual">Installation Manual</a> <ul> <li><a href="#forwarding-squid-logs-from-a-remote-squid-host-important">Forwarding Squid logs from remote host</a></li> </ul> </li> </ul> </li> <li> <a href="#accessing-the-admin-panel">Accessing the Admin Panel</a> </li> <li> <a href="#-telegram-notifications-setup-optional">Telegram Notifications Setup</a> <ul> <li><a href="#prerequisites-1">Prerequisites</a></li> <li><a href="#getting-telegram-api-credentials">Getting Telegram API Credentials</a></li> <li><a href="#configuration">Configuration</a></li> <li><a href="#finding-chat-ids">Finding Chat IDs</a></li> <li><a href="#proxy-support">Proxy Support</a></li> </ul> </li> <li> <a href="#resetting-forgotten-password-localhost-only">Resetting Forgotten Password</a> </li> <li> <a href="#update-projectweb-with-script">Update Project</a> </li> <li> <a href="#-run-on-system-startup">Run on System Startup</a> </li> <li> <a href="#testing-information">Testing Information</a> </li> <li> <a href="#uninstall-squidstats">Uninstall SquidStats</a> <ul> <li><a href="#using-the-uninstall-script">Using the Uninstall Script</a></li> <li><a href="#what-does-the-uninstall-do">What Does the Uninstall Do?</a></li> <li><a href="#manual-uninstallation">Manual Uninstallation</a></li> </ul> </li> <li> <a href="#upcoming-features">Upcoming Features</a> </li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#technologies-used">Technologies Used</a></li> <li><a href="#special-thanks">Special thanks</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

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

SquidStat

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:

  1. 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
    
  2. 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
    
  3. Verify Cache Manager is Working:

    # Test cache manager access
    curl http://127.
    
View on GitHub
GitHub Stars34
CategoryDevelopment
Updated2d ago
Forks8

Languages

Python

Security Score

95/100

Audited on Apr 7, 2026

No findings