cisco

Python Exscript - JunOS

a 夏天 提交于 2019-12-11 13:58:58
问题 I'm trying to to run a script to show all of the configuration and write them on files for juniper and CISCO routers. So far the CISCO script is working as it should but the thing is with the juniper router. for ii in JUNIPER: print ii cmd2 = 'show configuration | display set' conn.connect(ii) conn.login(account1) conn.execute(cmd2) print conn.response #filerouter = open(ii, "w") #filerouter.write(conn.response) #filerouter.close() After getting the list of devices to query, I run this but it

Exception:“The request was aborted: The connection was closed unexpectedly” When invoking two methods same object

杀马特。学长 韩版系。学妹 提交于 2019-12-11 13:17:23
问题 I am having a problem that many people have experienced but all of the solution that are available online are specific to their scenarios. I have tried the suggestions available but still no luck wha I have tried was: 1.) req.KeepAlive = false; 2.) req.ProtocolVersion = HttpVersion.Version10; (this solved a different exception that I was getting) I have two methods passing XML string to the server and getting responses back the two methods are: public string userDeviceQuery(string userID) {

“new VpnApiClass()” get COM Exception 800701e7 till reboot

房东的猫 提交于 2019-12-11 10:24:45
问题 I am using the CISCO COM object accessed via Interop.VpnApiLib in a C#, .NET2.0 project on Windows 8.1, 64 bit. I create an instance of the class VpnApiClass from this library with the following line: vpnApiLib = new VpnApiClass(); Sometimes this line of code works, but too often, I get the following Exception: Retrieving the COM class factory for component with CLSID {C15C0F4F-DDFB-4591-AD53-C9A71C9C15C0} failed due to the following error: 800701e7. Only a Windows reboot helps in such a

HTTP 500 error when importing Meraki SDK into python Azure function app

白昼怎懂夜的黑 提交于 2019-12-10 23:34:13
问题 When I import Meraki: from meraki.meraki import Meraki it causes a HTTP 500 error. This works as expected on my local machine but when uploaded to my Python Azure Function app it causes the HTTP 500 error. I suspect that this is because the Meraki SDK can be installed on my local machine but not on the Azure function app? How could this be installed within the Azure function app? Any help with this would be much appreciated! 来源: https://stackoverflow.com/questions/56564225/http-500-error-when

Ruby script to telnet switch

可紊 提交于 2019-12-08 07:45:10
问题 I've created the following ruby script that telnet to Cisco devices, that telnet to Cisco devices and run command 'show int status err'. require 'net/telnet' C3550_20_PterraEst = "192.168.244.20" #Enter the IP address here USER = "user" #Enter username here PASS = "password" #Enter password here ENABLE = "password" #Enter enable password here print "Selezionare il piano [0-1-2-All]: "; # get the input from the console, val1 = gets; tn = Net::Telnet::new("Host" => C3550_20_PterraEst, "Timeout"

Golang SSH to Cisco Wireless Controller and Run Commands

橙三吉。 提交于 2019-12-06 13:14:07
I am trying to SSH to a Cisco wireless controller through Go, using Go's golang.org/x/crypto/ssh library, to programmatically configure access points. The problem I'm running into is correctly parsing the controller CLI in Go. For example, this is the typical SSH login to the controller: $ ssh <controller_ip> (Cisco Controller) User: username Password:**************** (Cisco Controller) > I am trying to figure out how to send the username and then the password after the SSH session is established in Go. So far, I am able to successfully SSH to the controller, but the program exits at the

SNMP: ifAdminStatus vs ifOperStatus

爷,独闯天下 提交于 2019-12-04 22:06:42
问题 I have a question about ifAdminStatus and ifOperStatus. Here is an output of my network interfaces state using ifAdminStatus: snmpwalk -Os -c public -v 1 192.168.1.1 1.3.6.1.2.1.2.2.1.7ifAdminStatus.1 = INTEGER: up(1) ifAdminStatus.12 = INTEGER: down(2) ifAdminStatus.13 = INTEGER: up(1) ifAdminStatus.14 = INTEGER: up(1) And here is the same list using ifOperStatus: snmpwalk -Os -c public -v 1 192.168.1.1 1.3.6.1.2.1.2.2.1.8 ifOperStatus.12 = INTEGER: down(2) ifOperStatus.13 = INTEGER: down(2)

What is the difference between exec_command and send with invoke_shell() on Paramiko?

喜你入骨 提交于 2019-12-04 01:58:10
问题 So what is the difference between SSHClient.exec_command() and send with SSHClient.invoke_shell on Paramiko? I can send and execute command with exec_command to MikroTik router device but can't execute it with send ( invoke_shell() ). On the other hand, I can send and execute command send ( invoke_shell() ) to Cisco device, but can't execute it with exec_command . The command I mean is the configuration command like routing (ip route xxx xxx) or make vlan or add an ip address and etc.. 回答1:

Converting subnet mask “/” notation to Cisco 0.0.0.0 standard

ぐ巨炮叔叔 提交于 2019-12-03 22:53:26
问题 I've searched SO for help but could'nt find a answer to my question. Situation: I need to convert a "/NN" subnet mask notation (think IPTABLES) to a 0.0.0.0 cisco notation. NN are the number of "1" in the submask, from the lowest octet to the higher. Each octet are 8 bit integers. Possible solution: Make a array of 32 "0" and filling the last NN digits with "1", then group in 4 octets and converting to int... a /23 mask should be like 0.0.1.255. My question is how to do it in .NET... i never

paramiko Incompatible ssh peer (no acceptable kex algorithm)

你说的曾经没有我的故事 提交于 2019-12-03 19:07:24
问题 I'm getting the following error when trying to ssh to a Cisco ACS device using the paramiko library. I've used paramiko in python without issue, and I can ssh to this box from the command line, or using putty without issue. I've turned on debugging and copied the info here. Please let me know if you can help me out. import paramiko import sys import socket try: paramiko.common.logging.basicConfig(level=paramiko.common.DEBUG) sshConnection = paramiko.SSHClient() sshConnection.set_missing_host