NCM Expect references

Unanswered Question
Nov 3rd, 2008

Expect references

I am starting to get into expect scripting for NCM but I keep running into roadblocks. The NCM documentation does not go into very good details on using expect scripts. It has good references to Java, Perl and SOAP but none to expect nor does it have a good reference to the NCM command line. I am not a Unix guru so I don't know much about expect. Does anyone know of a good reference for these?

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Anonymous (not verified) Sun, 11/09/2008 - 09:40

I think Script Adapter (notifier) in NCM helps you. The Script Adapter (Notifier) allows you to automatically take an action when a notification is received. Upon receiving a notification, the Script Notifier invokes a custom script supplied by you that performs user-defined actions. For example, you can create a Script Notifier to send a page, using a paging service. Another Script Notifier might invoke an audible alarm when mission critical notifications are received.

Following URL helps you to configure script adapter:

bdemeulmeester Tue, 11/11/2008 - 06:39

I was looking more for a syntax of the except scripting language that NCM uses.

Joe Clarke Tue, 11/11/2008 - 07:06

NCM uses the standard Tcl-based expect scripting language. A sample expect script can be found in the NCM user's guide in appendix C. I've included it here:


# Sample Script to set the banner only if

# it is not already set correctly


spawn telnet $tc_device_ip$

set banner "****Unauthorized Access Prohibited****"

expect {

$banner {

puts "\nBanner is already set correctly\n"

exit 0

} "word:"


send "$tc_device_password$\r"

expect ">"

send "en\r"

expect "word:"

send "$tc_device_enable_password$\r"

expect "\#"

send "config t\r"

expect "\#"

send "banner motd /$banner/\r"

expect "\#"

send "exit"

More on the expect language can be found at . Help on the Tcl scripting language can be found at . The NCM user's guide can be found at .


This Discussion