eczema / ciscocmd-cosi Goto Github PK
View Code? Open in Web Editor NEWciscocmd repository for COSI
Home Page: https://sourceforge.net/projects/cosi-nms/files/ciscocmd/
License: GNU General Public License v2.0
ciscocmd repository for COSI
Home Page: https://sourceforge.net/projects/cosi-nms/files/ciscocmd/
License: GNU General Public License v2.0
Hi,
I've committed here a patch for a problem I was having with ciscocmd: the programm tries to access a variable, catches the resulting exception, and accesses the same variable again in the exception handler, resulting in yet another exception, which is not caught the second time:
can't read "expect_out(0,string)": no such element in array
while executing
"set loginbuf $expect_out(0,string)"
("foreach" body line 35)
invoked from within
"foreach host $hostlist {
#####################
# Login to the host #
#####################
if { [ info exist debugfile ] } {
if { $FORK == 1 ||..."
(file "/home/tpo/bin/ciscocmd" line 444)
Details and the patch can be found here: d42e317
The patch is against @leprechau 's fork, but applies identically to @eczema's tree as well
A Debian Stretch user named Denis (alias "sharlino") is reporting problems ciscocmd under Bash 4.4 but not 4.3. I quote his message:
ciscocmd is not working as expected with bash 4.4 (and maybe higher). On
today, 26-12-2016, the recent version of bash in the Debian Stretch is 4.4.2.
Downgrading bash from 4.4 to 4.3 has solved the problem. I think the
problem is in the IFS, particularly in the delimeters, because of:The `mapfile' builtin now has a -d option to use an arbitrary character
as the record delimiter, and a -t option to strip the delimiter as
supplied with -d.as per as https://lists.gnu.org/archive/html/info-gnu/2016-09/msg00008.html
I'm raising this issue for the proper follow up. I'll point the user to this issue.
Hi
I am not a well experienced programmer but google could not help me out with this issue
If I ssh to a Cisco switch I get the following error .
Processing... LAB-SW32
couldn't compile regular expression pattern: quantifier operand invalid
while executing
"expect -nobrace -re {'@'.
} {
set macro 1
if { [ info exist logfd ] && $logger == 1 } {
regsub -all -- "^G" $expect_out(buffer) "" add
..."
invoked from within
"expect {
-re "'@'.\r\n" {
set macro 1
if { [ info exist logfd ] && $logger == 1 } {
regsub -all -- "^G" $expect_out(buffer) "" add
..."
(procedure "waitprompt" line 20)
invoked from within
"waitprompt "
("foreach" body line 70)
invoked from within
"foreach host $hostlist {
#####################
# Login to the host #
#####################
if { [ info exist debugfile ] } {
if { $FORK == 1 ||..."
And I don‘t know how to solve it .
Tried Telnet as well with the same result and ciscocmd on different Linux Distros without success.
What‘s wrong on that Regex ?
Regards Markus
Hi
I had used this script a long time back and I think this would be really useful to configure multiple NX-OS switches using the console for initial remote deployment of switches. Would you be able to help me on how I can configure this script so I can go through the initial POAP disable and use the -r file function to use the config file to provision the switch.
Any help would be much appreciated.
I´m getting the following output when trying to execute ciscocmd. I see activity in the target machine but then get this output.
Processing... 10.1.6.31
send: spawn id exp6 not open
while executing
"send "$password\r""
("foreach" body line 63)
invoked from within
"foreach host $hostlist {
#####################
# Login to the host #
#####################
if { [ info exist debugfile ] } {
if { $FORK == 1 ..."
(file "./ciscocmd" line 467)
Any ideas of what might be wrong? Thanks
We're using ciscocmd in combination with ssh-key based autologin.
It turns out that ciscocmd fails to detect the next valid line if ssh key authentication in combination with a predefined ssh username is being used.
We have therefore enhanced ciscocmd to detect a possible prompt even before the first waitprompt call.
Modifications are as follows:
--- /data/shared/install/ciscocmd
+++ /usr/local/bin/ciscocmd
@@ -496,7 +496,7 @@
}
- catch { expect -re "(assword)|(ser(name)?)|(yes/no)" }
+ catch { expect -re "(assword)|(ser(name)?)|(yes/no)|(> *$)" }
if { [ catch { set loginbuf "$expect_out(0,string)" } ] } {
# if { [ catch { set loginbuf "$expect_out(2,string)" } ] } {
# set loginbuf "$expect_out(3,string)"
@@ -532,6 +532,9 @@
varcheck "password" 1
send "$password\r"
}
+ "> " {
+ varcheck "password" 0
+ }
default {
exit
}
Maybe you would like to included that for the official version.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.