Skip to content

HACKER2025998/xutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xUtils — System Monitoring Automation Tool

██╗  ██╗██╗   ██╗████████╗██╗██╗     ███████╗
╚██╗██╔╝██║   ██║╚══██╔══╝██║██║     ██╔════╝
 ╚███╔╝ ██║   ██║   ██║   ██║██║     ███████╗
 ██╔██╗ ██║   ██║   ██║   ██║██║     ╚════██║
██╔╝ ██╗╚██████╔╝   ██║   ██║███████╗███████║
╚═╝  ╚═╝ ╚═════╝    ╚═╝   ╚═╝╚══════╝╚══════╝

One command. Full monitoring stack. Fully automated.


Table of Contents


Overview

xUtils automates the installation, configuration, and management of:

Tool Category What it does
Nagios Monitoring Infrastructure & service checks
Zabbix Monitoring Enterprise agent-based monitoring
Graylog Log Management Centralized log aggregation
Wazuh SIEM/XDR Security events & intrusion detection
Grafana Dashboards Metrics visualization
Prometheus Metrics Time-series data collection
Fail2ban Security SSH/HTTP brute-force prevention

Without xUtils: 30 minutes → several hours per tool, with risk of error.
With xUtils: xutils install nagios — done in minutes.


Architecture

xutils/
├── main.go                    # Entry point
├── cmd/                       # CLI commands (Cobra)
│   ├── root.go                # Root command + banner
│   ├── install.go             # xutils install [tool]
│   ├── configure.go           # xutils configure / uninstall / update
│   ├── doctor.go              # xutils doctor
│   ├── status.go              # xutils status
│   ├── ssh.go                 # xutils ssh [host] [command]
│   ├── ai.go                  # xutils ai [question]
│   └── list.go                # xutils list
├── core/
│   ├── detector/              # Auto OS detection (Debian/Ubuntu/Arch/Fedora/macOS/Windows)
│   ├── executor/              # Command runner (local + SSH)
│   └── logger/                # Structured logging
├── modules/
│   └── common/                # All tool installers
│       ├── installer.go       # Base interface + registry
│       ├── nagios.go
│       ├── zabbix.go
│       ├── graylog.go
│       ├── wazuh.go
│       └── grafana_prometheus_fail2ban.go
├── ai/
│   └── assistant.go           # Ollama AI + fallback KB
├── Makefile                   # Build, cross-compile, package
├── Dockerfile                 # Multi-stage Docker build
├── install.sh                 # Universal install script
└── .github/workflows/
    └── release.yml            # CI/CD: test → build → release

Tech stack: Go 1.22 · Cobra CLI · golang.org/x/crypto/ssh · Ollama AI


Installation

One-liner (Linux/macOS)

curl -fsSL https://raw.githubusercontent.com/xutils/xutils/main/install.sh | bash

Debian/Ubuntu

# Add repository
curl -fsSL https://packages.xutils.dev/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/xutils.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/xutils.gpg] https://packages.xutils.dev/apt stable main" \
    | sudo tee /etc/apt/sources.list.d/xutils.list
sudo apt-get update
sudo apt-get install xutils

# Or download .deb directly:
wget https://github.com/xutils/xutils/releases/latest/download/xutils_1.0.0_amd64.deb
sudo dpkg -i xutils_1.0.0_amd64.deb

Fedora/RHEL

sudo dnf config-manager --add-repo https://packages.xutils.dev/rpm/xutils.repo
sudo dnf install xutils

Arch Linux

# Via AUR (yay):
yay -S xutils

# Via pacman (manual):
git clone https://aur.archlinux.org/xutils.git
cd xutils && makepkg -si

Windows

winget install xutils.xutils

Or download the .exe from GitHub Releases and add to %PATH%.

Build from source

Requirements: Go 1.22+, Git

git clone https://github.com/xutils/xutils.git
cd xutils
make deps    # Download Go modules
make build   # Build for current platform
make install # Install to /usr/local/bin/

Usage

# System diagnostics
xutils doctor

# List all available tools
xutils list

# Install a tool (interactive, auto-detects OS)
sudo xutils install nagios
sudo xutils install zabbix
sudo xutils install graylog
sudo xutils install wazuh
sudo xutils install grafana
sudo xutils install prometheus
sudo xutils install fail2ban

# Simulate install (no changes made)
sudo xutils install nagios --dry-run

# Skip all prompts (use defaults)
sudo xutils install nagios --yes

# Check service status
xutils status
xutils status nagios

# Reconfigure an installed tool
sudo xutils configure nagios

# Remove a tool
sudo xutils uninstall nagios

# AI-powered diagnostics
xutils ai "Why is Nagios not starting?"
xutils ai "How to add Wazuh agents?"
xutils ai "Graylog is slow, how to optimize?"

Commands Reference

xutils [command] [flags]

Commands:
  install     Install a monitoring/security tool
  configure   Reconfigure an installed tool
  uninstall   Remove a tool and its data
  update      Update an installed tool
  doctor      Run full system diagnostics
  status      Show status of installed tools
  ssh         Run commands on a remote host
  ai          AI-powered diagnostics assistant
  list        List all available tools
  version     Show version information

Global Flags:
  -v, --verbose    Enable verbose output
  --dry-run        Simulate without making changes
  --no-color       Disable colored output
  -h, --help       Show help

Install Flags:
  -y, --yes        Skip confirmation prompts
  --ssh host       Remote host for installation
  --user user      SSH username (default: root)
  --key  path      SSH private key path
  --port port      SSH port (default: 22)

SSH Remote Mode

Install tools on a remote server without logging in manually:

# Using SSH key (recommended)
xutils install nagios --ssh 192.168.1.50 --user ubuntu --key ~/.ssh/id_rsa

# Using user@host shorthand
xutils install wazuh --ssh admin@myserver.com

# Run diagnostics on remote host
xutils ssh root@10.0.0.1 doctor

# Check status on remote
xutils ssh admin@prod-server.com status

AI Assistant

xUtils includes an AI assistant powered by Ollama (local, private):

# Setup Ollama (one time):
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3

# Ask questions:
xutils ai "Why is Nagios not starting?"
xutils ai "How do I configure Zabbix for 500 hosts?"
xutils ai "Graylog memory is too high"
xutils ai "Add remote agent to Wazuh"

# Use a specific model:
xutils ai --model mistral "Optimize Prometheus retention"

If Ollama is not installed, xUtils falls back to a built-in knowledge base with pre-defined solutions for common issues.


Development Guide

Run locally

git clone https://github.com/xutils/xutils.git
cd xutils
go mod download

# Run without installing
go run . --help
go run . list
go run . doctor

# Build
make build
./xutils --help

# Run tests
make test

# Cross-compile all platforms
make cross-build

Project structure for adding a new tool

  1. Create modules/common/mytool.go
  2. Implement the Installer interface:
    type MyToolInstaller struct {
        base *BaseInstaller
    }
    func (m *MyToolInstaller) Install() error    { ... }
    func (m *MyToolInstaller) Configure() error  { ... }
    func (m *MyToolInstaller) Uninstall() error  { ... }
    func (m *MyToolInstaller) Update() error     { ... }
    func (m *MyToolInstaller) ShowPlan()         { ... }
    func (m *MyToolInstaller) DryRun()           { ... }
    func (m *MyToolInstaller) PrintSummary()     { ... }
  3. Register in modules/common/installer.goGetInstaller() switch

Release

git tag v1.1.0
git push origin v1.1.0
# GitHub Actions auto-builds and publishes release

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/add-elastic
  3. Implement your changes
  4. Write tests
  5. Submit a pull request

License

MIT License — see LICENSE


xUtils — Because life is too short for manual monitoring setup.

About

xutils is an tools who help to configure and install fast monitoring and SIEM tools like at Nagios wazzuh graylog to a remote or local server or desktop

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors