Skip to content

fam007e/bdix-server-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

σ°’’ BDIX Server Monitor

License: MIT C17 Build

A high-performance, secure, and modular BDIX (Bangladesh Internet Exchange) server monitoring tool written in modern C17. Features multithreaded server checking, real-time latency monitoring, and beautiful terminal UI.

✨ Features

  • πŸ”„ Multithreaded Checking - Concurrent server testing with configurable thread pools
  • πŸ“Š Real-time Monitoring - Live latency measurements and status updates
  • πŸ“ Markdown Export - Save successful check results to a file
  • 🎨 Beautiful UI - Color-coded terminal output with progress indicators
  • πŸ”’ Security First - Input validation, bounds checking, and secure HTTP
  • πŸ“¦ Modular Design - Clean separation of concerns for maintainability
  • ⚑ High Performance - Optimized C implementation with minimal overhead
  • πŸ§ͺ Well Tested - Comprehensive unit test coverage

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        main.c                           β”‚
β”‚                   (Entry Point)                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                  β”‚             β”‚            β”‚
β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”
β”‚   ui.c     β”‚    β”‚  config.c  β”‚  β”‚server.c β”‚  β”‚checker.cβ”‚
β”‚ (Display)  β”‚    β”‚  (Loader)  β”‚  β”‚ (Data)  β”‚  β”‚ (HTTP)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
                                                     β”‚
                                              β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                              β”‚ thread_pool.c  β”‚
                                              β”‚  (Concurrency) β”‚
                                              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Prerequisites

Required Dependencies

  • GCC >= 9.0 or Clang >= 10.0
  • libcurl >= 7.68.0
  • jansson >= 2.13
  • pthread (POSIX threads)

Installation (Ubuntu/Debian)

sudo apt update
sudo apt install build-essential libcurl4-openssl-dev libjansson-dev

Installation (Fedora/RHEL)

sudo dnf install gcc make libcurl-devel jansson-devel

Installation (macOS)

brew install curl jansson

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/fam007e/bdix-server-monitor.git
cd bdix-server-monitor

2. Build

make

3. Run

./bin/bdix-monitor

Or install system-wide:

sudo make install
bdix-monitor

πŸ“– Usage

Interactive Mode

❯ ./bdix-monitor
[INFO] Checker subsystem initialized

╔═════════════════════════════════════════════════════════╗
β•‘         BDIX SERVER MONITOR - SECURE C EDITION          β•‘
β•‘     Multithreaded FTP, TV, and Media Server Tester      β•‘
β•‘                    Version 1.0.0                        β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

[INFO] Server data initialized successfully
[WARN] File does not exist: data/server.json
[INFO] Found configuration at: ../data/server.json
[INFO] Loading servers from: ../data/server.json
[INFO] Loading configuration from: ../data/server.json
[INFO] Successfully loaded 891 servers from configuration
[SUCCESS] Loaded: 596 FTP, 80 TV, 215 other servers


╔════════════════════ MENU ══════════════════╗
β•‘ 1. Check FTP Servers                       β•‘
β•‘ 2. Check TV Servers                        β•‘
β•‘ 3. Check Other Servers                     β•‘
β•‘ 4. Check All Servers                       β•‘
β•‘ 5. Set Thread Count (Current: 15)          β•‘
β•‘ 6. Toggle Show Only OK (Current: OFF)      β•‘
β•‘ 7. Server Statistics                       β•‘
β•‘ 8. Reload Configuration                    β•‘
β•‘ 9. Save Results to Markdown                β•‘
β•‘ 0. Exit                                    β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Enter choice: 0
[SUCCESS] Exiting... Goodbye!
[INFO] Checker subsystem cleaned up

This will launch an interactive menu in your terminal. Use the arrow keys or number keys to navigate.

  • Options 1-4: Check servers.
  • Option 9: Save Results to Markdown. This will export the list of currently ONLINE servers to a timestamped file (e.g., bdix_results_20251215_120000.md).

Command Line Options

bdix-monitor [OPTIONS]

Options:
  -c, --config FILE      Use custom config file (default: data/server.json)
  -t, --threads NUM      Number of threads (1-64, default: 15)
  -f, --ftp              Check only FTP servers
  -v, --tv               Check only TV servers
  -o, --others           Check only other servers
  -a, --all              Check all servers (default)
  -q, --quiet            Show only successful checks
  -n, --no-color         Disable colored output
  -i, --interactive      Start in interactive mode (default)
  -s, --stats            Show statistics only
  -h, --help             Show this help message
  -V, --version          Show version information

Examples

# Check all servers with 32 threads
bdix-monitor --threads 32

# Check only FTP servers, show only successful
bdix-monitor --ftp --quiet

# Use custom config file
bdix-monitor --config /path/to/servers.json

πŸ“ Configuration

Create data/server.json:

{
  "ftp": [
    "http://ftp.amigait.com",
    "http://ftp.dhakacom.net",
    "http://ftp.circleftp.net"
  ],
  "tv": [
    "http://tv.bdix.app",
    "http://iptv.live.net.bd"
  ],
  "others": [
    "http://cache.google.com",
    "http://mirror.dhakacom.com"
  ]
}

πŸ§ͺ Development

Build Debug Version

make debug

Run Tests

make tests
make check

Code Formatting

make format

Static Analysis

make analyze

πŸ“š Documentation

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“Š Performance

Typical performance on modern hardware:

  • 100 servers: ~2-5 seconds (15 threads)
  • 500 servers: ~10-15 seconds (32 threads)
  • Memory usage: ~2-5 MB
  • Thread overhead: Minimal with thread pool

πŸ” Security

  • Input validation on all user inputs
  • Bounds checking on arrays and buffers
  • SSL/TLS verification enabled
  • No arbitrary code execution
  • Safe string operations (no strcpy/sprintf)
  • Memory sanitization on cleanup

πŸ“œ License

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

πŸ™ Acknowledgments

  • Original Python version: 0xAhmadYousuf/BDIX
  • Inspired by the BDIX community in Bangladesh
  • Built with ❀️ for network administrators

πŸ“ž Contact

About

A professional, modular C implementation of BDIX server checker with multithreading, JSON parsing, and real-time monitoring.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors