Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦€ Rust System Tools

Rust License Build Status

Collection of high-performance CLI system tools written in Rust. Fast, safe, and production-ready utilities for system administration, monitoring, and analysis.

πŸ“¦ Tools

1. πŸ“Š Log Analyzer (loglyzer)

Powerful log file analyzer with pattern matching, statistics, and real-time monitoring.

Features:

  • Parse multiple log formats (Common Log, JSON, custom patterns)
  • Real-time log monitoring with --follow
  • Statistical analysis (error rates, response times, traffic patterns)
  • Filter by date range, log level, or regex patterns
  • Generate reports in JSON, CSV, or Markdown
  • Colorized output for better readability

Usage:

# Analyze access logs
loglyzer analyze /var/log/nginx/access.log

# Monitor logs in real-time
loglyzer follow /var/log/app.log --level ERROR

# Generate statistics
loglyzer stats /var/log/app.log --format json

# Filter by date range
loglyzer analyze app.log --from 2026-02-01 --to 2026-02-26

2. πŸ” Performance Monitor (perfmon)

System performance monitoring tool with resource tracking and alerting.

Features:

  • Real-time CPU, memory, disk, and network monitoring
  • Process-level resource tracking
  • Historical data collection with configurable intervals
  • Threshold-based alerting
  • Export metrics to Prometheus format
  • Beautiful TUI (Terminal UI) dashboard

Usage:

# Start monitoring with TUI dashboard
perfmon dashboard

# Monitor specific process
perfmon process --pid 1234

# Record metrics to file
perfmon record --interval 5s --output metrics.json

# Export to Prometheus
perfmon export --format prometheus

3. ⚑ Process Manager (procman)

Advanced process management utility with batch operations.

Features:

  • List processes with detailed information
  • Filter by name, user, CPU, or memory usage
  • Batch operations (kill, pause, resume)
  • Process tree visualization
  • Resource limits enforcement
  • Generate process reports

Usage:

# List all processes
procman list

# Find processes by name
procman find nginx

# Kill processes using regex
procman kill --pattern "worker-.*"

# Show process tree
procman tree --pid 1

# Monitor top consumers
procman top --by cpu --limit 10

4. πŸ”’ File System Auditor (fsaudit)

File system monitoring and security auditing tool.

Features:

  • Monitor file changes in real-time
  • Detect unauthorized modifications
  • Calculate and verify file hashes
  • Track file permissions and ownership changes
  • Generate audit reports
  • Integration with inotify (Linux) and FSEvents (macOS)

Usage:

# Watch directory for changes
fsaudit watch /var/www/html

# Verify file integrity
fsaudit verify --baseline baseline.json /etc

# Generate baseline snapshot
fsaudit snapshot /etc --output baseline.json

# Audit permissions
fsaudit audit /var --check-permissions

5. 🌐 Network Tool (netutil)

Network diagnostics and analysis toolkit.

Features:

  • Port scanner with service detection
  • TCP/UDP connectivity testing
  • DNS lookup and reverse DNS
  • HTTP/HTTPS endpoint testing
  • SSL/TLS certificate information
  • Bandwidth testing
  • Network interface statistics

Usage:

# Scan ports
netutil scan localhost --ports 1-1000

# Test HTTP endpoint
netutil http https://api.example.com

# DNS lookup
netutil dns google.com

# SSL certificate info
netutil ssl https://example.com

# Interface statistics
netutil stats --interface eth0

6. πŸ“¦ Disk Analyzer (disklyzer)

Disk space analysis and visualization tool.

Features:

  • Recursive directory size calculation
  • Find largest files and directories
  • Duplicate file detection
  • Interactive tree visualization
  • Export reports in various formats
  • Fast parallel scanning

Usage:

# Analyze directory
disklyzer analyze /home/user

# Find large files
disklyzer top /var --size 100MB

# Find duplicates
disklyzer duplicates /home --by hash

# Visualize directory tree
disklyzer tree /var/log --depth 3

πŸš€ Installation

From Source

# Clone repository
git clone https://github.com/ElioNeto/rust-system-tools.git
cd rust-system-tools

# Build all tools
cargo build --release

# Install to ~/.cargo/bin
cargo install --path loglyzer
cargo install --path perfmon
cargo install --path procman
cargo install --path fsaudit
cargo install --path netutil
cargo install --path disklyzer

Using Cargo

cargo install loglyzer
cargo install perfmon
cargo install procman
# ... etc

Pre-built Binaries

Download from Releases


πŸ› οΈ Development

Prerequisites

  • Rust 1.75 or higher
  • Cargo
  • Linux, macOS, or Windows

Project Structure

rust-system-tools/
β”œβ”€β”€ loglyzer/           # Log analyzer tool
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ parser.rs
β”‚   β”‚   β”œβ”€β”€ analyzer.rs
β”‚   β”‚   └── reporter.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ perfmon/            # Performance monitor
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ collector.rs
β”‚   β”‚   β”œβ”€β”€ dashboard.rs
β”‚   β”‚   └── metrics.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ procman/            # Process manager
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ process.rs
β”‚   β”‚   └── tree.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ fsaudit/            # File system auditor
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ watcher.rs
β”‚   β”‚   └── hasher.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ netutil/            # Network utilities
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ scanner.rs
β”‚   β”‚   └── ssl.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ disklyzer/          # Disk analyzer
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main.rs
β”‚   β”‚   β”œβ”€β”€ scanner.rs
β”‚   β”‚   └── visualizer.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ shared/             # Shared utilities
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ lib.rs
β”‚   β”‚   β”œβ”€β”€ cli.rs
β”‚   β”‚   └── output.rs
β”‚   └── Cargo.toml
β”œβ”€β”€ Cargo.toml          # Workspace config
└── README.md

Building

# Build all tools
cargo build --release

# Build specific tool
cargo build -p loglyzer --release

# Run tests
cargo test --all

# Run clippy
cargo clippy --all

Running

# Run without installing
cargo run -p loglyzer -- analyze /var/log/app.log
cargo run -p perfmon -- dashboard

πŸ“š Technical Details

Key Dependencies

  • clap: Command-line argument parsing
  • tokio: Async runtime for I/O operations
  • serde: Serialization/deserialization
  • regex: Pattern matching
  • chrono: Date/time handling
  • colored: Terminal colors
  • indicatif: Progress bars
  • tui: Terminal UI framework
  • sysinfo: System information
  • notify: File system events
  • openssl: SSL/TLS operations

Performance Optimizations

  • Parallel Processing: Uses rayon for CPU-bound operations
  • Memory Efficient: Streaming processing for large files
  • Zero-Copy: Minimizes allocations where possible
  • Async I/O: Non-blocking operations with tokio
  • Compiled Native: No runtime overhead

Safety

  • Memory Safe: No null pointers, no buffer overflows
  • Thread Safe: Fearless concurrency with Rust's type system
  • Error Handling: Explicit error types with Result/Option
  • No Undefined Behavior: Compiler enforced safety

🎯 Use Cases

DevOps & SRE

  • Monitor production systems
  • Analyze application logs
  • Troubleshoot performance issues
  • Audit security configurations

System Administration

  • Manage system resources
  • Monitor disk usage
  • Track file changes
  • Network diagnostics

Development

  • Debug applications
  • Profile performance
  • Analyze log patterns
  • Test network connectivity

Security

  • File integrity monitoring
  • Permission auditing
  • Network scanning
  • Change detection

πŸ”₯ Performance Benchmarks

Log Analyzer

File: 10GB nginx access.log (50M lines)
loglyzer: 12.3s
python script: 245.6s
β†’ 20x faster

Disk Analyzer

Scan: 500GB directory (2M files)
disklyzer: 8.7s
du -sh: 45.2s
β†’ 5x faster

Process Monitor

Memory Usage: 4.2 MB
CPU Usage: < 1%
Update Frequency: 100ms

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

Guidelines

  • Follow Rust conventions and idioms
  • Add tests for new features
  • Update documentation
  • Run cargo fmt and cargo clippy

πŸ“„ License

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


πŸ‘¨β€πŸ’» Author

Elio Neto


πŸ™ Acknowledgments

  • Inspired by traditional Unix tools
  • Built with the amazing Rust ecosystem
  • Thanks to the open-source community

πŸ—ΊοΈ Roadmap

  • Add Windows support for all tools
  • Implement web dashboard for perfmon
  • Add machine learning for log pattern detection
  • Create systemd service integration
  • Add Kubernetes metrics collection
  • Implement distributed tracing support
  • Create plugin system for extensibility
  • Add integration with Prometheus/Grafana

Made with πŸ¦€ and ❀️ in Rust

⭐ Star this repo if you find it useful!

About

πŸ¦€ Collection of high-performance CLI system tools written in Rust - Log analyzer, performance monitor, process manager, and more

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages