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
TaborSpace - 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, andCtrl+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:
- Build a clean distribution.
- Inspect wheel and sdist contents.
- Scan for private hostnames, internal domains, internal paths, real customer case identifiers, credentials, tokens, and personal usernames.
- Run
twine check dist/*.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c9ab2c4c53bb9473da8c96eb5e966e4122bcd0c8384922a8da72bc3edda7463
|
|
| MD5 |
a61708fcb2e9bdff36530dcd30565ac7
|
|
| BLAKE2b-256 |
fabb272cb2a89b51b1313757bb404c6bb65ffe089d8ba3b8e76f21ab5bfbb23e
|
File details
Details for the file rsi_varlog_explorer-1.6.4-py3-none-any.whl.
File metadata
- Download URL: rsi_varlog_explorer-1.6.4-py3-none-any.whl
- Upload date:
- Size: 102.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a6348dfeffd3580e372a4b6fccc1091145a0d419e102caef0dac81dc80f9a71
|
|
| MD5 |
6ecbb89de238508255fc59611eb2cd0d
|
|
| BLAKE2b-256 |
d14c0367c13ba6c91154814beed46a9e25be332410c2a5b2f64d191d12caf74e
|