Giter Site home page Giter Site logo

transcode-sros's Introduction

transcode-sros

Python script to transcode Nokia SROS config in flat mode

Description : Allow to transcode a SROS config file collected by admin display-config in a flat config file The only limitation is do not have 4 space characters in your description as indentation is made of 4 space characters

How to use:

python transcode-sros.sh

or to save in file

python transcode-sros.sh > flat-config.txt

Example.

more mysros.cfg 
Generated FRI NOV 25 08:15:08 2016 UTC

exit all
configure
--------------------------------------------------
echo "System Configuration"
--------------------------------------------------
	system
		name "BOB"
		location "Bayonne Hardoy"
		chassis-mode d
		config-backup 6
		dns
		exit
		load-balancing
			l4-load-balancing
			lsr-load-balancing lbl-ip
		exit
		rollback
			rollback-location "cf3:/rollback"
			local-max-checkpoints 20
		exit
		snmp
			packet-size 9216
		exit
		time
			ntp
				server x.x.x.x prefer
				no shutdown
			exit
			sntp
				shutdown
			exit
			dst-zone CEST
				start last sunday march 02:00
				end last sunday october 03:00
			exit
			zone CET
		exit
		thresholds
			rmon
			exit
		exit
	exit

python trancode-sros.py mysros.cfg
/configure system name "BOB"
/configure system location "Bayonne Hardoy"
/configure system chassis-mode d
/configure system config-backup 6
/configure system dns
/configure system load-balancing l4-load-balancing
/configure system load-balancing lsr-load-balancing lbl-ip
/configure system rollback rollback-location "cf3:/rollback"
/configure system rollback local-max-checkpoints 20
/configure system snmp packet-size 9216
/configure system time ntp server x.x.x.x prefer
/configure system time ntp no shutdown
/configure system time sntp shutdown
/configure system time dst-zone CEST start last sunday march 02:00
/configure system time dst-zone CEST end last sunday october 03:00
/configure system time zone CET
/configure system thresholds rmon

transcode-sros's People

Contributors

door7302 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.