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

Prerequisites

  • Python 3.8 or later
  • Read access to the case directory or RSI file
  • A writable work directory for read-only case paths

No Junos device access or root permission is required.

Installation

Install from PyPI:

python3 -m pip install --user rsi-varlog-explorer

Verify the command:

rsi-varlog --version

If rsi-varlog is not found, add the user install path to PATH:

export PATH="$HOME/.local/bin:$PATH"
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

For shared servers where case directories are read-only, configure a writable staging root once:

export RSI_VARLOG_WORK_ROOT_TEMPLATE="/shared/work/{user}/case"
echo 'export RSI_VARLOG_WORK_ROOT_TEMPLATE="/shared/work/{user}/case"' >> ~/.bashrc

Usage

Most users only need to provide the case directory:

rsi-varlog /path/to/case-directory

For example:

rsi-varlog /shared/cases/case-123

If the case directory is read-only, the tool automatically stages a writable copy before extracting archives. On a shared server, set this once:

export RSI_VARLOG_WORK_ROOT_TEMPLATE="/shared/work/{user}/case"

Then users can keep using the simple command:

rsi-varlog /shared/cases/case-123

The effective working copy becomes:

/shared/work/<current-user>/case/case-123

You can also pass a writable work root per command:

rsi-varlog /shared/cases/case-123 --work-dir /shared/work/<user>/case

Use --refresh-stage if the staged copy already exists and you want to recopy it:

rsi-varlog /shared/cases/case-123 --refresh-stage

If you already have a direct RSI file, pass the file path:

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

If auto-detection picks the wrong files, specify them 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

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>

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.5.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.5-py3-none-any.whl (102.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rsi_varlog_explorer-1.6.5.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.5.tar.gz
Algorithm Hash digest
SHA256 98594807ac9787f249373d572f9948be47c209571e0ff2a8c9a8b1f559140500
MD5 538d2381cebb7112db20ecb4b9e2ef8d
BLAKE2b-256 30a2099dc530b295ad6aacf12cfe603a49d45823e4491dceeec1147c7689ec0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rsi_varlog_explorer-1.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 839cdd98edf9d13de39752607a5126fe2b6302ac93977a4327aacb537db5a59e
MD5 b4e156fcba7993372d0f05f3d5f1bdae
BLAKE2b-256 ec079fe7a81dd01aa5fc2488f18d91cd0c3b47066348bc19c9adf29f8011ed4b

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