ezdo(n) 1.3 ezdo "Easy Do Commands"

NAME

ezdo - execute common commands

SYNOPSIS

package require libcisco

ezdo savecfg ?options?
ezdo clearcntrs
ezdo debug Args
ezdo undebug Args
ezdo reload ?options?

DESCRIPTION

The ezdo command is used to perform a specifc task on a Cisco network device. The "Easy" family of functions provide an OS layer of abstraction for common commands. The first argument to ezdo specifies the task to be performed on the target device. A list of valid tasks and their associated options is detailed below.

Note: Before making a call to ezdo, a session must first be opened to the target device using the session open command.

COMMANDS

ezdo savecfg ?options?
Saves the configuration in RAM to NVRAM.

The following options are supported:

-ifchanged
The configuration will be saved only if a change has been made.

--
End of options.


On success, ezdo savecfg returns 0. On error, a short text message is returned beginning with the string "err".

ezdo clearcntrs
Clears all counters on the target system.

On success, ezdo clearcntrs returns 0. On error, a short text message is returned beginning with the string "err".

ezdo debug Args
Enable debugging on the target device. (IOS only)

Args is one or more arguments to be concatenated together and evaluated on the target system as a debug command.

On success, ezdo debug returns 0. On error, a short text message is returned beginning with the string "err".

ezdo undebug Args
Disable debugging on the target device. (IOS only)

Args is one or more arguments to be concatenated together and evaluated on the target system as an undebug command.

On success, ezdo undebug returns 0. On error, a short text message is returned beginning with the string "err".

ezdo reload ?options?
Reload/reset the target system. If the target host is an IOS system and its running-config is different from the startup-config, the config will first be saved to NVRAM before resetting.

The following options are supported:

-nosave
IOS only. The configuration will NOT be saved if the running-config is different from the startup-config.

--
End of options.


On success, ezdo reload returns 0. On error, a short text message is returned beginning with the string "err".

EXAMPLE

The following code will open a session to 192.168.1.1, put the device in "enable" mode, enable ICMP debugging, clear the counters, and logout.

 
#!/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
ezdo debug ip icmp
ezdo clearcntrs
session close

AUTHOR

Andy Ziegelbein <
mailto:aziegelb@users.sourceforge.net>

SEE ALSO

session(n), sendCmd(n), ezset(n), ezget(n)

KEYWORDS

ezdo, clear, counters, save, config, debug, undebug