github akpw/mktxp v2.0.3
MKTXP v2.0.3

4 hours ago

MKTXP v2.0.3

📖 Blogs

Beyond Metrics: Instant RouterOS Diagnostics with MKTXP 2.0 -- a deep dive into live terminal diagnostics, client registration monitoring, and targeted network filtering.
Under the Hood: Refactoring MKTXP for 2.0 -- reasons and architecture breakdown of the 2.0 modular core / multi-domain extensibility.

✨ New Features

Live CLI Diagnostics (mktxp diag / mktxp print):

An interactive terminal diagnostic suite providing domain-specific network visibility with scoped filtering:

  • Ethernet & SFP Interface Monitor (-im): Monitors physical Ethernet and SFP port link state, negotiated PHY rates, duplex, and optical transceiver DOM diagnostics

    • --degraded [RATE]: Isolates ports dropping below threshold (default: < 100M) or running half-duplex. Accepts custom sub-rates (e.g. --degraded 1G for sub-gigabit links)
    • --plugged / --unplugged: Filter active vs disconnected ports
    • --rate [RATE] / --rate-below [RATE]: Filter by exact or threshold PHY rate
    • --sfp-only: Surfaces SFP/QSFP transceivers and DOM optical levels
  • Wireless & CAPsMAN Health (-wc, -cc): Live registration tables grouped by AP interface with client counts

    • --low-signal (default <= -75 dBm) & --min-signal: Pinpoint fringe clients or healthy, strong connections
    • --low-rate (default <= 18M): Filter low PHY rate clients
    • --recent (default 15m): Filter newly connected clients based on uptime
    • --band 2g|5g|6g: Filter by frequency band
  • DHCP Leases & Device Discovery (-dc):

    • --unidentified: Audit mystery devices lacking hostnames
    • --dynamic / --static: Filter dynamic leases vs reserved static IPs
    • --active-only / --inactive-only: Filter by lease binding state (active bound vs inactive / waiting)
  • IP Connection Tracking (-cn):

    • --top [N] (default 10): Surface top socket-consuming source hosts
    • --min-conns [N]: Filter out low-volume hosts
  • Real-Time Bandwidth & Top Talkers (-kc):

    • --top [N]: Rank top talkers across your LAN by active throughput
    • --active: Surface devices with non-zero traffic
    • --rate-above [RATE]: Filter devices exceeding bandwidth thresholds (e.g. 2M, 500k)
    • --dynamic-only / --static-only / --unassigned: Filter Kid Control profiles
  • Firewall Address Lists (-al): Inspect IPv4 and IPv6 firewall address lists

    • --dynamic-only: Surface active dynamic threat bans and auto-added scanner entries
    • --static-only: Show permanent static list entries only
  • Upstream & Netwatch Health (-nw): Monitor RouterOS Netwatch ICMP probe targets and gateway reachability

    • --down-only: Show failing or unreachable targets only
    • --up-only: Show passing and reachable targets only
  • Universal Pattern Filtering (-in, -ex):

    • -in, --include / -ex, --exclude: Semicolon-separated substring and wildcard matching (*, ?) across all diagnostic table fields
  • Context-Aware Scoped Help:

    • Appending -h to any diagnostic command (e.g. mktxp diag -kc -h) dynamically scopes help output to only filters and options applicable to that specific
      domain, printing active thresholds loaded from _mktxp.conf

Prometheus Metrics & Collectors:

  • Wireless Frequency Band Metric: Added frequency band label (band="2g"|"5g"|"6g") to wireless metrics, enabling band-separated Grafana dashboards.
  • Address List Scrape Timeouts: Preventing scrape timeouts on routers with large address-list tables, #329

🚀 Improvements

  • Core Modular Architecture: Refactored monolithic modules into domain packages (mktxp.diag, mktxp.cli, mktxp.exporter, mktxp.rsc, mktxp.utils), improving testability and separation of concerns
  • Piped Output Support: Auto-detects non-interactive stdout / pipe redirections to disable ANSI color formatting for clean scripting integration
  • Prefix Command Matching: Options parser matches unique prefix initial sequences (e.g. --wifi, --caps, --dhcp, --conn, --kid, --addr, --net, --interface)
  • Comprehensive Documentation: Split monolithic documentation into dedicated, modular guides (docs/diagnostics.md, docs/configuration.md, docs/gitops_rsc.md)
  • PyPI Metadata & Packaging: Added categorized PyPI classifiers for network monitoring, console environments, and direct URLs for docs, changelog, and issues
  • Test Suite Expansion: Added comprehensive unit test coverage across CLI filtering, table formatters, and diagnostics registry

🐛 Bug Fixes

  • mktxp edit: Fixed TypeError with fallback editor detection when invoking editor action
  • Script Extraction Permissions: Preserved RouterOS script metadata, permissions, and policies when extracting .rsc sidecars
  • Version Introspection: Added dynamic local development version resolver (_version.py), ensuring version bumps in pyproject.toml immediately reflect across CLI info and test suites

⚙️ New Router Configuration Options (mktxp.conf)

[Sample-Router]
    total_address_list_counts = True      # Firewall Address List total counts across all lists (set False if large lists cause timeouts)
    ipv6_total_address_list_counts = True # IPv6 Firewall Address List total counts across all lists (set False if large lists cause timeouts)

⚙️ New System Configuration Options (_mktxp.conf)

[DIAG]
    # Wireless & CAPsMAN defaults
    low_signal_threshold = -75          # Default dBm threshold for --low-signal (matches <= -75 dBm)
    min_signal_threshold = -60          # Default dBm threshold for --min-signal (matches >= -60 dBm)
    low_rate_threshold = '18M'          # Default rate for --low-rate (matches <= 18 Mbps)
    recent_duration = '15m'             # Default duration for --recent (matches uptime <= 15m)

    # IP Connections & Bandwidth defaults
    top_connections_count = 10          # Default limit for connection stats --top
    rate_above_threshold = '1M'         # Default rate for kid control / bandwidth --rate-above

    # Interface Monitor defaults
    degraded_threshold = '100M'         # Default rate for interface monitor --degraded (matches < 100 Mbps or half-duplex)

Don't miss a new mktxp release

NewReleases is sending notifications on new releases.