![]() So what you know in TCL, you essentially can port over to Expect scripts. Expect utilizes the TCL language, and all of its commands (as well as some of its own). The use of Expect really helps save me a lot of time and it speeds up the troubleshooting process with the vendor. Expect will make your life a lot easier in cases like this. You can also download the complete shell script here. $MAILEXE -s "ALERT: Dump Report for $SWITCH" $MAIL_LIST -a $PATH_TO/$ < $MAILTXT # obvious piece is the list of switches that you'd like the script run against. # account for all scripting purposes that are "read-only" in nature. I would highly suggest using the ro (ReadOnly) # of MUTT if email is used and most importantly the username and password to the # to the location of the Bash script and supporting Expect script. # There are system and network specific variables below. ![]() ![]() # The output will then be saving to the working directory using Occasionally you might have multiple switches that you’ll need to interrogate and for that I’ve written a quick and dirty little Bash shell script to loop through the FQDN of the switches calling the Expect script above. You can also download the complete Expect script from my website here. #send - "show ip route info alternative\r" # YOU CAN ADD AND REMOVE COMMANDS AS YOU SEE FIT Send_log "* STARTING LOGFILE FOR $SWITCH ON $DATE \r\n" Send_user " password the password for username\n" Send_user " username the username for login to the switch \n" Send_user " switch the DNS or IP address of switch \n" active state tcl 8, active tcltk, tcl tk, activetcl expect, expect, activestate expect, active tcl expect, tcl teacup. Training, Open Source computer languages. ActiveTcl from ActiveState is the industry-standard, commercial-grade Tcl distribution, available for Windows, Linux and Mac OS X (Solaris, AIX and HP-UX available in Business or Enterprise Edition). Send_user "ERROR: command line paramaters incorrect\n" tcl+expect - The Tcl programming language - Tcl/ Tcl/Tk, and Expect forum discussion. # Purpose: display the usage information to the enduser. # script wasn't run conservatively originally Set force_conservative 0 # set to 1 to force conservative mode even if ActiveTcl is the industry-standard Tcl distribution, available for Windows, Linux, Mac OS X, Solaris, AIX and HP-UX. # Expect and autoexpect were both written by Don Libes, NIST. # This Expect script was generated by autoexpect on Thu Aug 18 10:57:50 2005 # May 6, 2003: original Expect script generated from auto_expect # May 20, 2003: fine tuned script removing a great many "expect" commands. # Mar 18, 2005: added file logging for troubleshooting and monitoring # Dec 30, 2005: added command line arguments for portability # Sept 29, 2006: cleaned up script/updated documentation # a filename based on the switch name used to call the script. # The output will then be saved to the working directory using # via telneting to the device and issuing various "show" cmds. Have the code in front of me, but I remember it.# Purpose: Dump technical information from Nortel Ethernet Routing Switch That's coming from the main loop in the ConsoleDebugger class. >Jeff, did that get fixed? > This is still an issue in the current codebase. >I thought that got fixed? I remember that bug. David Gravereaux wrote: >Frederic RISS wrote: >On Fri, at 03:46 -0400, Dave Fisher wrote: >Second, the system call does NOT put the output on the connected pipes >(stdin/stdout/stderr) of a spawned process because it creates another >process - this is why you are timing out on them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |