Real-time file system monitoring tool with simple terminal interface and comprehensive logging capabilities.
git clone https://github.com/your-username/FileMonitor.git
cd FileMonitor
chmod +x setup_and_run.sh
./setup_and_run.shThis script will:
- Install all dependencies (GCC, Python packages)
- Build the C monitoring program
- Create configuration files
- Set up test environment
- Launch interactive menu
-
Install dependencies:
# Ubuntu/Debian sudo apt update && sudo apt install gcc libjson-c-dev python3-pip # Fedora/RHEL sudo dnf install gcc json-c-devel python3-pip # Arch Linux sudo pacman -S gcc json-c python-pip
-
Install Python packages:
pip3 install --user -r requirements.txt
-
Build the monitor:
python3 src/fmon.py build -t all
python3 src/interactive_menu.py
# or
python3 src/fmon.py --interactiveUse arrow keys to navigate through options:
- Start/stop monitoring
- View logs and status
- Configure settings
- Test monitoring
Start monitoring current directory:
python3 src/fmon.py start . --backgroundMonitor parent directory (project root):
python3 src/fmon.py start . --parent --backgroundMonitor project root automatically:
python3 src/fmon.py start . --project-root --backgroundEnhanced monitoring with unlimited capacity:
python3 src/fmon.py start /large/directory --enhanced --backgroundMonitor parent directory with specific levels:
python3 src/fmon.py start /path/to/dir --parent --levels 3 --backgroundCheck status (supports all monitor types):
python3 src/fmon.py statusView performance statistics:
python3 src/fmon.py perfView recent logs:
python3 src/fmon.py logs show
python3 src/fmon.py logs show --enhanced # Enhanced monitor logsReal-time log monitoring:
python3 src/fmon.py logs tail
python3 src/fmon.py logs tail --enhanced # Enhanced monitor logsStop monitoring:
python3 src/fmon.py stopEdit monitor.conf to customize monitoring:
# Enable recursive directory monitoring
recursive=true
# Monitor specific file extensions
extension=js
extension=html
extension=css
extension=py
extension=jsonConfiguration commands:
# Set extensions
python3 src/fmon.py config set extensions txt,py,js
# Set recursive mode
python3 src/fmon.py config set recursive true
# Show current config
python3 src/fmon.py config show- Three monitor types: Basic, Advanced (with checksums), Enhanced (dynamic scaling)
- Dynamic watch management: No hard limits on watched directories
- Real-time statistics: Memory usage, event counts, watch statistics
- Automatic scaling: Watch capacity expands based on needs
- Performance metrics: JSON-based statistics with detailed monitoring info
- Parent directory monitoring: Monitor 1-5 levels up from current directory
- Project root detection: Automatically detect
.git,package.json,requirements.txt, etc. - Smart targeting: Monitor entire project from any subdirectory
- Flexible levels: Choose how many parent levels to monitor
- File events: Create, modify, delete, move, attribute changes
- Directory monitoring: Recursive or single-level
- Performance: Low CPU usage with inotify
- Filtering: Extension-based filtering for focused monitoring
- Unlimited capacity: Enhanced monitor handles large directory trees
- Comprehensive logs: All events with timestamps
- Enhanced statistics: Real-time metrics in JSON format
- Log viewing: Show recent entries or real-time monitoring
- Log rotation: Automatic log management for enhanced monitor
- Color-coded logs: Error, info, and debug level highlighting
# Start enhanced monitoring with unlimited capacity
python3 src/fmon.py start /large/project --enhanced --background
# Monitor with project root detection
python3 src/fmon.py start . --project-root --enhanced --background
# View enhanced statistics
python3 src/fmon.py perf # Shows both basic and enhanced stats
# View enhanced logs with color coding
python3 src/fmon.py logs show --enhanced
python3 src/fmon.py logs tail --enhanced# Monitor parent directory (1 level up)
python3 src/fmon.py start . --parent --background
# Monitor specific levels up
python3 src/fmon.py start /project/src --parent --levels 2 --background
# Auto-detect and monitor project root
python3 src/fmon.py start . --project-root --background# Start background monitoring
python3 src/fmon.py start /home/user/projects --background
# Enhanced background monitoring
python3 src/fmon.py start . --enhanced --project-root --background
# Check if running (shows all monitor types)
python3 src/fmon.py status
# View logs while running
python3 src/fmon.py logs tail# View real-time performance statistics
python3 src/fmon.py perf
# Monitor performance in real-time
watch -n 2 'python3 src/fmon.py perf'# Show recent logs
python3 src/fmon.py logs show
# Real-time log monitoring
python3 src/fmon.py logs tail# Set custom extensions
python3 src/fmon.py config set extensions js,ts,jsx,tsx
python3 src/fmon.py config set recursive true
# View current config
python3 src/fmon.py config showFileMonitor/
├── src/ # Source code
│ ├── main.c # C monitoring program (basic)
│ ├── advanced_monitor.c # C monitoring program (advanced with checksums)
│ ├── enhanced_monitor.c # C monitoring program (enhanced with dynamic scaling)
│ ├── fmon.py # Python CLI interface
│ └── interactive_menu.py # Interactive menu system
├── docs/ # Documentation
│ ├── QUICK_START.md # Quick start guide
│ └── ENHANCED_FEATURES.md # Enhanced features guide
├── build/ # Built executables
├── enhanced_stats.json # Enhanced monitor statistics
├── enhanced_monitor.log # Enhanced monitor logs
├── setup_and_run.sh # Setup script
├── requirements.txt # Python dependencies
└── README.md # This file
# Clone repository
git clone https://github.com/your-username/FileMonitor.git
cd FileMonitor
# Build C programs
python3 src/fmon.py build -t all
# Install Python dependencies
pip3 install --user -r requirements.txt# Test basic monitoring
python3 src/fmon.py start test_monitoring --background
echo "test content" > test_monitoring/test.txt
python3 src/fmon.py logs show
python3 src/fmon.py stop
# Test enhanced monitoring
python3 src/fmon.py start . --enhanced --background
touch test_file.txt
python3 src/fmon.py perf # View enhanced statistics
python3 src/fmon.py logs show --enhanced
python3 src/fmon.py stop
# Test parent directory monitoring
mkdir -p project/src
cd project/src
python3 ../../src/fmon.py start . --parent --background
echo "test" > ../test.txt # Create file in parent
python3 ../../src/fmon.py logs show
python3 ../../src/fmon.py stop- OS: Linux (uses inotify)
- Compiler: GCC
- Libraries: json-c, pthread, openssl, zlib, pcre
- Python: 3.6+
- Python packages: rich, click, inquirer, psutil
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Rich for terminal output
- Uses Click for CLI framework
- Interactive menus powered by Inquirer
- Quick Start Guide - Get started quickly
- Enhanced Features Guide - Detailed guide for new capabilities

