ezget - get common information
SYNOPSIS
package require libcisco
|
The ezget command is used to get information from Cisco network equipment. The first argument to ezget specifies the type of information to get from the target device. A list of valid information elements and their associated options is detailed below.
Note: Before making a call to ezget, a session must first
be opened to the target device using the session open command.
The following code will get the configuration from 192.168.1.1 and print it
to the screen (stdout).
COMMANDS
ConfigType may be one of two options--primary or
secondary. The primary option will cause the command to
get the running-config from an IOS device, the complete config of a switch
running Catalyst code, and the complete configuration of a 1900. The
secondary option will cause the function to retrieve the
startup-config from an IOS device, the nondefault config from a switch
running Catalyst code, and nothing from a 1900.
On success, ezget config returns the configuration.
On error, a short text message is returned beginning with the string "err".
varNameArray is optional. It is the name of a variable.
The variable should be an array. The following elements will be set
if varNameArray is specified:
On success, ezget version returns the complete OS version.
On error, a short text message is returned beginning with the string "err".
EXAMPLE
#!/bin/sh # the next line restarts using the tclsh interpreter \ exec tclsh "$0" "$@" package require libcisco namespace import libcisco::* session open 192.168.1.1 cisco session enable san-fran set Config [ ezget config primary ] session close puts $Config |