Нет описания

Manuel d745fbced4 fix: url install.sh 1 год назад
.idea 4f450126a7 🎨 add graphs, script for install and some changes 1 год назад
assets 4e88309f2a update readme and upload news assets 1 год назад
database b6d6cc96ea add mariaDB support and some changes 1 год назад
parsers 4f450126a7 🎨 add graphs, script for install and some changes 1 год назад
services 4f450126a7 🎨 add graphs, script for install and some changes 1 год назад
static b6d6cc96ea add mariaDB support and some changes 1 год назад
templates 28ed44dca1 feat: update web squidStats 1 год назад
utils d745fbced4 fix: url install.sh 1 год назад
.gitignore 6c51a019a0 fix bug cache page 1 год назад
LICENSE 7242ab717e Create LICENSE 1 год назад
README.md 394392847b add line break 1 год назад
app.py 28ed44dca1 feat: update web squidStats 1 год назад
install.sh ef8690bb2c fix: typo install.sh 1 год назад
requirements.txt b6d6cc96ea add mariaDB support and some changes 1 год назад

README.md

Squid Log Parser Dashboard 🐙📊

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.


Examples

🌟 Features

  • 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...
  • And More

⚠️ First Execution Alert ⚠️

Warning: 🚨 The first execution may cause high CPU usage.

🚀 Getting Started

Prerequisites

  • Python 3.10+
  • Squid proxy server
  • squidclient installed on the server
  • ⚠️ !!Important ⚠️ 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
    

Installation With Script(Beta Version)

  1. Get Script With curl o wget:

    wget https://github.com/kaelthasmanu/SquidStats/releases/download/0.2/install.sh
    
  2. Add permission execution:

    sudo chmod +x install.sh
    
  3. Execute the script:

    sudo ./install.sh
    

Installation Manual

  1. Clone the repository:

    git clone https://github.com/kaelthasmanu/SquidStats.git
    cd SquidStats
    
  2. Install requeriments python with pip or pip3:

    pip install -r requirements.txt
    
  3. Create a .env file in the project root and add the following content:\ Note: for use MARIADB need your own database running

    SQUID_HOST="127.0.0.1"
    SQUID_PORT=3128
    FLASK_DEBUG = "True"
    DATABASE_TYPE="SQLITE" # You can use "MARIADB" or "SQLITE"
    SQUID_LOG = "/home/manuel/Desktop/SquidStats/parsers/access.log"
    DATABASE_STRING_CONNECTION = "/home/manuel/Desktop/SquidStats/" #or mysql+pymysql://user:password@host:port/db
    REFRESH_INTERVAL = 60
    
  4. Run App with python or python3 🚀:

    python app.py
    
  5. With your preferred browser, visit the installation URL:

    http://ip/hostname:5000 
    

🕒 Run on System Startup To ensure the application starts automatically when the system boots, add the following cron job:

  1. Open with a editor the file crontab

    nano /etc/crontab
    
  2. Add the following line to the crontab file(change path_app for your path):

    @reboot root nohup python3 path_app/app.py &
    
  3. Save

🧪 Testing Information

This software has been thoroughly tested and is compatible with Squid version 6.12. Please ensure your Squid installation matches this version or newer for optimal performance.

🛠️ Technologies Used

Backend: Python, Flask Frontend: HTML, CSS

🤝 Contributing

  1. Fork the repository:

    git checkout -b feature-name
    

    2.Create a new branch for your feature or fix:

    git checkout -b feature-name
    

    3.Commit your changes and push the branch:

    git push origin feature-name
    

    4.Open a pull request.

Contact

Manuel - (Telegram) (Email)

Project Link: (SquidStats)

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.