All Projects → Juniper → Jsnapy

Juniper / Jsnapy

Licence: other
Python version of Junos Snapshot Administrator

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Jsnapy

Hiyapyco
HiYaPyCo - A Hierarchical Yaml Python Config
Stars: ✭ 58 (-28.4%)
Mutual labels:  yaml
Countries States Cities Database
🌍 World countries, states, regions, provinces, cities, towns in JSON, SQL, XML, PLIST, YAML, and CSV. All Countries, States, Cities with ISO2, ISO3, Country Code, Phone Code, Capital, Native Language, Timezones, Latitude, Longitude, Region, Subregion, Flag Emoji, and Currency. #countries #states #cities
Stars: ✭ 1,130 (+1295.06%)
Mutual labels:  yaml
The Practical Linux Hardening Guide
This guide details creating a secure Linux production system. OpenSCAP (C2S/CIS, STIG).
Stars: ✭ 8,790 (+10751.85%)
Mutual labels:  audit
Publisher Ads Lighthouse Plugin
Publisher Ads Lighthouse Plugin is a tool to improve ad speed and overall quality through a series of automated audits. This tool will aid in resolving discovered problems, providing a tool to be used to evaluate effectiveness of iterative changes while suggesting actionable feedback.
Stars: ✭ 58 (-28.4%)
Mutual labels:  audit
Ansible In Action
Ansible playbook to deploy your Laravel code base to VPS
Stars: ✭ 61 (-24.69%)
Mutual labels:  yaml
Audit Stash
Flexible and rock solid audit log tracking for CakePHP 3
Stars: ✭ 66 (-18.52%)
Mutual labels:  audit
Feedr
Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).
Stars: ✭ 56 (-30.86%)
Mutual labels:  yaml
Perftools Runner
Google Performance Tools runner using Puppeteer
Stars: ✭ 79 (-2.47%)
Mutual labels:  audit
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (+1287.65%)
Mutual labels:  audit
Pynms
A vendor-agnostic NMS for carrier-grade network simulation and automation
Stars: ✭ 73 (-9.88%)
Mutual labels:  yaml
Vim Yaml Folds
YAML, RAML, EYAML & SaltStack SLS folding for Vim
Stars: ✭ 59 (-27.16%)
Mutual labels:  yaml
Github Labeler
Declarative way to configure GitHub labels
Stars: ✭ 62 (-23.46%)
Mutual labels:  yaml
Jokeapi
A REST API that serves uniformly and well formatted jokes in JSON, XML, YAML or plain text format that also offers a great variety of filtering methods
Stars: ✭ 71 (-12.35%)
Mutual labels:  yaml
Re Txt
converts text-formats from one to another, it is very useful if you want to re-format a json file to yaml, toml to yaml, csv to yaml, ... etc
Stars: ✭ 59 (-27.16%)
Mutual labels:  yaml
Pytorch Project Template
Deep Learning project template for PyTorch (Distributed Learning is supported)
Stars: ✭ 76 (-6.17%)
Mutual labels:  yaml
Yaml2go
Converts YAML specs into Go Lang type definitions
Stars: ✭ 57 (-29.63%)
Mutual labels:  yaml
Yaml
A fast, idiomatic and easy to use Clojure YAML library. Based on Snake YAML
Stars: ✭ 66 (-18.52%)
Mutual labels:  yaml
Mini Yaml
Single header YAML 1.0 C++11 serializer/deserializer.
Stars: ✭ 79 (-2.47%)
Mutual labels:  yaml
Config Lite
A super simple & flexible & useful config module.
Stars: ✭ 78 (-3.7%)
Mutual labels:  yaml
Nginx Baseline
DevSec Nginx Baseline - InSpec Profile
Stars: ✭ 71 (-12.35%)
Mutual labels:  audit

PyPi Version Coverage Status Coverage Status

JSNAPy

Python version of Junos Snapshot Administrator

JSNAPy logo

Inspired by https://github.com/Juniper/junos-snapshot-administrator

Abstract

Junos Snapshot Administrator enables you to capture and audit runtime environment snapshots of your networked devices running the Junos operating system (Junos OS).

You can write your test cases in yaml file and run those tests cases against pre and post snapshots.

Installation

Installation requires Python 2.7 and associated pip tool

1. Install using pip command
      sudo pip install jsnapy
2. Install using pip command from github
      sudo pip install git+https://github.com/Juniper/jsnapy.git 
3. Updating using pip command (from github)
      sudo pip install -U git+https://github.com/Juniper/jsnapy.git 
4. Download or clone the source code from this git repository
      git clone https://github.com/Juniper/jsnapy
   Or Untar jsnapy-master.zip (if downloaded zip folder)
      unzip jsnapy-master.zip
   Go to jsnapy-master folder and install by:
      sudo python setup.py sdist
      sudo pip install dist/jsnapy-x.x.tar.gz

Hello, World

JSNAPy requires one main config file and test files. Config file contains device details and test files to be executed.

config_check.yml:

# for one device, can be given like this:
    hosts:
      - device: router 
        username : abc
        passwd: pqr
    tests:
      - test_no_diff.yml 

test_no_diff.yml

test_command_version:
  - command: show interfaces terse lo* 
  - iterate:
      xpath: physical-interface
      id: './name'
      tests:
        - no-diff: oper-status       # element in which test is performed
          err: "Test Failed!! oper-status  got changed, before it was <{{pre['oper-status']}}>, now it is <{{post['oper-status']}}>"
          info: "Test Passed!! oper-status is same, before it is <{{pre['oper-status']}}> now it is <{{post['oper-status']}}> 

To run this test execute following command:

1. jsnapy --snap pre -f config_check.yml (for taking pre snapshot)
2. jsnapy --snap post -f config_check.yml (for taking post snapshot after some modification)
3. jsnapy --check pre post -f config_check.yml (compares pre post snapshot as per test cases)
4. jsnapy --diff pre post -f config_check.yml (compares pre post snapshot files, shows the diff in 2 Columns)

Output will look something like this:

(venv)sh-3.2# jsnapy --check pre post -f config_single_check.yml 
*************************Performing test on Device: 10.209.16.204*************************
Tests Included: test_command_version 
*************************Command is show interfaces terse lo**************************
----------------------Performing no-diff Test Operation----------------------
Test succeeded!! oper_status is same, before it is <['up']> now it is <['up']> 
Final result of no-diff: PASSED 
------------------------------- Final Result!! -------------------------------
Total No of tests passed: 1
Total No of tests failed: 0 
Overall Tests passed!!! 

File Paths:

1. config file   
   can give either:
    - full file path  
    - only file name, in this case JSNAPy will first look in present working 
      directory, if file is not present then it will take file path from "config_file_path" 
      in jsnapy.cfg file. Default config file path is "/etc/jsnapy"
2. test file: 
    - full file path  
    - only file name, in this case it will take path from "test_file_path" in jsnapy.cfg file. 
      Default test file path is "/etc/jsnapy/testfiles"
3. snap file:
    - full file path
    - tag, in this case file name is formed automatically (<devicename>_<tag>_<command/rpc>.<xml/text>)
      Snap files will be taken from "snapshot_path" in jsnapy.cfg file. 
      Default path is "/etc/jsnapy/snapshots"

jsnap2py:

Tool to convert conf file of JSNAP slax into yaml file that can be consumed by JSNAPy.

jsnap2py -i test_interface.conf

This will convert slax conf file "test_interface.conf" into yaml file "test_interface.yaml".
If you want to give different output file name, then use -o option

jsnap2py -i test_interface.conf -o interface.yml

For more information please refer [jsnap2py-wiki] (https://github.com/Juniper/jsnapy/wiki/7.-jsnap2py)

CONTRIBUTORS

Juniper Networks is actively contributing to and maintaining this repo. Please contact [email protected] for any queries.

Contributors:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].