Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?


Junos Snapshot Administrator in Python Overview

Junos® Snapshot Administrator in Python (jsnapy) enables you to capture and audit runtime environment snapshots of your networked devices running the Junos OS. You can capture and validate the operational and configuration status of a device and review operational changes to a device. You create configuration files that define the scope of snapshots and customize the test criteria for the snapshot data.

You can use Junos Snapshot Administrator in Python to perform the following functions on either a single device or list of devices running Junos OS:

  • Take a snapshot of the runtime environment on a device.

  • Compare two snapshots.

  • Audit a device’s runtime environment against pre-defined criteria.

  • Use it as a module in other Python programs.

  • Send e-mail alerts that include test results.

  • Store and compare snapshots in an SQLite database.

For example, prior to a software or hardware upgrade on a device, you can take a pre-install and post-install snapshot of the device and then compare the two snapshots. You can then review the operational changes on the device and validate these changes from a list of expected changes.

Figure 1 shows an operational overview of Junos Snapshot Administrator in Python.

Figure 1: Junos Snapshot Administrator in Python Operational OverviewJunos Snapshot Administrator in Python Operational Overview

Junos Snapshot Administrator in Python is installed on a remote server running an OS that can support Python, including Mac OS X, and many Linux distributions. The jsnapy server uses Junos PyEZ to make NETCONF connections over SSHv2 to your networked Junos OS devices. Using YAML-formatted configuration and test files for connection and test criteria, jsnapy sends RPC requests to the devices over the NETCONF connections. RPC replies are received back at the server in the form of snapshots. You can run jsnapy from the server command line or can be included as a module in other Python applications. See Understanding Junos Snapshot Administrator in Python when Running as a Python Module

The snapshots are formatted as text or XML files and are stored on the server in a location designated by the jsnapy.cfg file located in the directory /etc/jsnapy/. The full list of directories and files installed with jsnapy in the /etc/jsnapy directory can be seen in the Installing Junos Snapshot Administrator in Python Optionally, the snapshots can be stored in an SQLite database on the server. Jsnapy can then compare the snapshots either to other snapshots or to pre-defined criteria in order to audit the effects of configuration changes or to confirm proper device configuration.

The only requirement for Junos devices to work with jsnapy is that NETCONF and SSH must be enabled.

Junos Snapshot Administrator in Python logs information regarding its operations to the console and to the /var/log/jsnapy/jsnapy.log file by default. The level of logging performed can be set to DEBUG, INFO, ERROR, or CRITICAL by changing parameters in the /etc/jsnapy/logging.yml file. Using this file, you can change the logging level, disable logging to the console, or change the locations and names of the log files that jsnapy uses. The logging level can be temporarily set to debug by using the -v option when calling jsnapy from the CLI, for example:

jsnapy –snap PRE -f config_file.yml -v.