Skip to main content

Junos RSI and varlog explorer with interactive CLI simulator

Project description

rsi-varlog-explorer

An interactive tool for navigating Junos RSI output and var/log files through a simulated Junos CLI environment.

Features

  • Interactive Junos CLI simulation for RSI and var/log exploration
  • Auto-detects RSI files and var/log sources
  • Automatically extracts case archives
  • Handles single-RE and dual-RE var/log inputs
  • Supports operational and configuration mode navigation (configure, edit, top, up, exit)
  • Supports Junos-style ? help
  • Supports command completion and shorthand expansion with Tab or Space
  • Supports partial commands and common abbreviations, such as show int ter
  • Supports pipe processing: match, grep, except, find, last, count, trim, no-more, save, display set
  • Supports pager control with --no-pager, pager on/off, and Ctrl+C

Installation

pip install rsi-varlog-explorer

Verify the command:

rsi-varlog --version

Basic Usage

Analyze a local case directory:

rsi-varlog /path/to/case-directory

Analyze a direct RSI file:

rsi-varlog /path/to/device-rsi.log

Specify the RSI file or var/log directory explicitly:

rsi-varlog /path/to/case-directory --rsi-file device-rsi.log
rsi-varlog /path/to/case-directory --var-log-dir /path/to/var-log-dir
rsi-varlog /path/to/case-directory --var-log-dir /path/to/re0/var-log-dir /path/to/re1/var-log-dir

Read-Only Case Directories

If the input case directory is read-only, the tool can stage a writable copy before extracting archives.

Use --work-dir to provide a writable root directory. The tool creates a subdirectory named after the case directory:

rsi-varlog /readonly/path/to/case-123 --work-dir /writable/path/to/work

This analyzes:

/writable/path/to/work/case-123

You can also configure this once with an environment variable:

export RSI_VARLOG_WORK_ROOT=/writable/path/to/work
rsi-varlog /readonly/path/to/case-123

For multi-user systems, use a template with {user}:

export RSI_VARLOG_WORK_ROOT_TEMPLATE="/writable/path/{user}/case"
rsi-varlog /readonly/path/to/case-123

If no work directory is configured and the input case directory is read-only, the tool stages files under:

~/.cache/rsi-varlog-explorer/case/<case-directory-name>

Refresh an existing staged copy:

rsi-varlog /readonly/path/to/case-123 --refresh-stage

Archive Extraction

By default, archives are extracted in the effective case directory. For read-only inputs this is the staged copy.

You can redirect archive extraction explicitly:

rsi-varlog /path/to/case-directory --extract-dir /path/to/extract-dir

Interactive Commands

Examples inside the simulator:

show version
show log ?
show log messages | match error
show chassis hardware detail no-forwarding
show interfaces terse | match ge-
show configuration | display set
show configuration protocols bgp
quit

Press ? for contextual help. Press Ctrl+C to stop paging, and press Ctrl+C again to exit.

CLI Options

rsi-varlog <case-directory-or-rsi-file>
rsi-varlog <case-directory> --no-pager
rsi-varlog <case-directory> --extract-dir <dir>
rsi-varlog <case-directory> --work-dir <writable-root>
rsi-varlog <case-directory> --refresh-stage
rsi-varlog <case-directory> --rsi-file <path>
rsi-varlog <case-directory> --var-log-dir <dir>
rsi-varlog <case-directory> --var-log-dir <re0-dir> <re1-dir>

Development

python -m pip install -U build twine pytest
python -m pytest
python -m build
python -m twine check dist/*

Publishing Checklist

Before publishing to a public package index:

  1. Build a clean distribution.
  2. Inspect wheel and sdist contents.
  3. Scan for private hostnames, internal domains, internal paths, real customer case identifiers, credentials, tokens, and personal usernames.
  4. Run twine check dist/*.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsi_varlog_explorer-1.6.4.tar.gz (21.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rsi_varlog_explorer-1.6.4-py3-none-any.whl (102.0 kB view details)

Uploaded Python 3

File details

Details for the file rsi_varlog_explorer-1.6.4.tar.gz.

File metadata

  • Download URL: rsi_varlog_explorer-1.6.4.tar.gz
  • Upload date:
  • Size: 21.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for rsi_varlog_explorer-1.6.4.tar.gz
Algorithm Hash digest
SHA256 9c9ab2c4c53bb9473da8c96eb5e966e4122bcd0c8384922a8da72bc3edda7463
MD5 a61708fcb2e9bdff36530dcd30565ac7
BLAKE2b-256 fabb272cb2a89b51b1313757bb404c6bb65ffe089d8ba3b8e76f21ab5bfbb23e

See more details on using hashes here.

File details

Details for the file rsi_varlog_explorer-1.6.4-py3-none-any.whl.

File metadata

File hashes

Hashes for rsi_varlog_explorer-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6348dfeffd3580e372a4b6fccc1091145a0d419e102caef0dac81dc80f9a71
MD5 6ecbb89de238508255fc59611eb2cd0d
BLAKE2b-256 d14c0367c13ba6c91154814beed46a9e25be332410c2a5b2f64d191d12caf74e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page