Hi
I create a script whit python and i configure the commands.conf but appears the follow message: "External search command exited unexpectedly with non-zero error code 1"
commands.conf
[sshprueba8]
chunked = true
filename = sshprueba8.py
script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import paramiko
import sys
import time
HOST = "172.16.10.100"
USER = "admin"
PASS = "admin"
ITERATION = 1
#f = open ('/Documents/Archivo de prueba.txt','w')
def fn():
client1=paramiko.SSHClient()
client1.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client1.connect(HOST,username=USER,password=PASS)
stdin, stdout, stderr = client1.exec_command('show ip interface brief')
saveoutput = open("/Users/RicardoMedina/Documents/Archivo de prueba.txt", "a")
saveoutput.write(stdout.read())
print stdout.read()
fn()
↧