Home » Questions » Computers [ Ask a new question ]

Need a sample script to perform an automated action on a Cisco router via ZOC SSH

Need a sample script to perform an automated action on a Cisco router via ZOC SSH

Does anymone show me a script sample using the software "ZOC Terminal" (version 6.2) to perform an simple automatic action on a router, let's say a reboot or change of daylight savings time or something like that.

Asked by: Guest | Views: 423
Total answers/comments: 1
Guest [Entry]

"REXX script:

/* REXX: reboot.zrx */
connectip= ""192.168.1.1""
connectname= ""ROUTERNAME""
connectpassword= ""telnetpassword""
enablepassword= ""enablepass""
CALL rebootrouter
EXIT

rebootrouter:
CALL ZocConnect connectip
CALL ZocWait ""Password:""
CALL ZocSend connectpassword||""^M""
CALL ZocWait "">""
CALL ZocSend ""enable^M""
CALL ZocWait ""Password:""
CALL ZocSend enablepassword||""^M""
CALL ZocWait ""#""
CALL ZocSend ""reload""
CALL ZocWait ""]""
CALL ZocSend ""y^M""
CALL ZocWait ""]""
CALL ZocSend ""y^M""
RETURN

(Shamelessly stol.. umm borrowed from here and posted with a few beautifications)"