This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Generate configuration files | |
template: src=access_switch3.j2 dest=/home/toddr/ANSIBLE/roles/access_switch/CFGS/{{item.hostname}}3.txt | |
with_items: switches | |
~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
# add your configurations in a list format | |
# | |
host_conf = ['config t', 'interface lo10', 'description TEST-CONFIG-SCRIPT-3', 'end', 'show run int loop 10'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Target hosts for this script lives in nexus_host.py | |
import time | |
from nexus_hosts import network_devices | |
import requests | |
import json | |
import getpass | |
UN = raw_input("Username : ") | |
PW = getpass.getpass("Password : ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host_conf = ['show ip arp vlan 11', 'show ip arp vlan 12', 'show ip arp vlan 13', 'show ip arp vlan 32', 'show ip arp vlan 50', 'show ip arp vlan 102', 'show ip arp vlan 112', 'show ip arp vlan 145', 'show ip arp vlan 150', 'show ip arp vlan 155', 'show ip arp vlan 160', 'show ip arp vlan 161', 'show ip arp vlan 171', 'show ip arp vlan 172', 'show ip arp vlan 327', 'show ip arp vlan 328', 'show ip arp vlan 331', 'show ip arp vlan 332', 'show ip arp vlan 374', 'show ip arp vlan 380', 'show ip arp vlan 401', 'show ip arp vlan 409', 'show ip arp vlan 433', 'show ip arp vlan 434', 'show ip arp vlan 435', 'show ip arp vlan 436', 'show ip arp vlan 334', 'show ip arp vlan 343', 'show ip arp vlan 403', 'show ip arp vlan 404', 'show ip arp vlan 406', 'show ip arp vlan 447','exit'] | |
# To implement config changes your config would be implemented in list format | |
# host_conf = ['config t', 'interface lo10', 'description TEST-CONFIG-SCRIPT-3', 'end', 'show run int loop 10'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pysnmp.entity.rfc3413.oneliner import cmdgen | |
cmdGen = cmdgen.CommandGenerator() | |
# Run through these hosts | |
IP = ['10.10.10.110', '10.10.10.120', '10.10.10.130'] | |
# | |
#http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=1.3.6.1.2.1.1.1#oidContent | |
# | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
archive | |
log config | |
logging enable | |
notify syslog contenttype plaintext | |
hidekeys | |
event manager applet Config_Change authorization bypass | |
event config | |
action 1.1 cli command "enable" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host_commands = [] | |
f = open('show_commands.txt', 'r') | |
for line in f: | |
host_commands.append(line.strip()) | |
f.close() | |
print host_commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = "ToddR" | |
# | |
# | |
import paramiko | |
import time | |
import getpass | |
UN = raw_input("Username : ") | |
PW = getpass.getpass("Password : ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This is the telnet Library for Python3 | |
#Make sure transport input telnet is enabled on router validate | |
#This scripts will run commands you choose on the remote devices using telnet as transport | |
#The results will be print to screen and captured in files named ("router_" + HOST) | |
#(c) 2017 Todd Riemenschneider | |
from getpass import getpass | |
import telnetlib | |
user = input("Username: ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := 1.0 | |
for i := 0; i < 10; i++ { |