|
wktools Version 4 Documentation - under construction |
Table of contents:
1. General
wktools is a collection of tools which simplify the work with network devices, especially Cisco devices. At this time there are the following tools included:
Configmaker, IP list, Configure Devices and Device Information Parser.
How to work with these tools is explaned in the following document.
1.1. License
The application is FREEWARE. Use at your own risk.
1.2. Questions and Feature Requests
Please send questions and Feature Requests to wktools@spoerr.org
1.3. Bug Reports
Please send Bug Reports to wktools@spoerr.org
1.4. Using wktools
1.5. Automatic version check
This feature was added in wktools Version 3.3.0.0.
wktools now checkes if there is a newer version available for download. It establishes a http session to www.spoerr.org and downloads a file with the version information. No other information is exchanged and all traffic is unencrypted.
Due to personal firewalls the version checker sometimes gets no connection and needs to timeout before the tool is startet. For the user it seems that the tool is not working. If this is the case for you, please disable the version check function in the Settings.
1.6. wktools.xml
All settings and tool profiles are saved in wktools.xml, which must be located in the same folder like wktools.exe.
2. wktools GUI
2.1. GUI layout
2.2. Toolbar
|
|
Load File - Only available for Scheduler to load a Scheduler File |
|
|
Save Log output to file; For Scheduler it's used to save the Scheduler table |
|
|
Copy selected Log window output to clipboard |
|
|
Paste clipboard to Log window |
|
|
Cut selected Log window output |
|
|
Delete Log Output |
|
|
Load selected Profile Choose the profile to load in the drop down box |
|
|
Save Profile Write the profile name into the drop down box or select an existing profile to overwrite it. |
| BOX |
Profile Selector DropDown Box Select or fill in the Profile name to load/save. |
|
|
DeviceGroup Refresh - Only available for Configure Devices; Load Device Group Table; Prerequisite to start Configure Devices |
|
|
Start/Stop Tool Select to start; unselect to stop |
|
|
Kill Tool - Use with caution. |
|
|
Settings |
|
|
Detailed Log/Error Log - Select for Error log only; unselect for Detailed Log |
2.3. Tool Selector
|
wktools - General information |
|
ConfigMaker: To simply generate many similar files/configurations. There are two data sources needed to achieve this: A pattern file and a data file. |
|
Configure Devices: To push/collect information to/from a network device. Supported protocols are Telnet, SSHv2, HTTP+S and Serial Console. |
|
IP List: To find and store IP addresses in config files. |
|
Device Information Parser: To parse Text files with "show" output from Cisco devices for Serial numbers, Module Information... - Very useful for making an inventory of your Installed base. |
|
Scheduler: To schedule Tasks/Tools at a specified time or start one or more tools at one time. |
|
|
About - General information. |
|
|
License - End User Agreement |
2.4. Tool Settings
To specify the Tool specific settings. Each setting is described in detail below.
2.5. Log Window
All output of wktools is written into this window. Please use to toggle between "Full Log" and "Error Messages only" views.
A documentation of all error messages is available here.
2.6. Tool specific output
This section is differenty used from each tool. ConfigMaker uses it to display the Data File, Configure Devices shows the DeviceGroup File and DeviceInformation Parser diplays the result. The Scheduler lists all configured items.
2.7. How to use the GUI
This section is differenty used from each tool. ConfigMaker uses it to display the Data File, Configure Devices shows the DeviceGroup File and DeviceInformation Parser diplays the result. The Scheduler lists all configured items.
3. Global Functions
3.1. CLI Options
It's possible to start wktools with some parameters to automatically load a profile or start a tool or disable the GUI...
SYNTAX: wktools [-s] [-S] [-h] [-t tool -p profile]
Option Details:| -s |
silent Do not start the GUI. Most used with scripts or cron jobs, where you need no GUI. |
| -S | Save the output to the specified log file |
| -t |
tool Use this option in combination with
|
| -p |
profile Load the specified profile for the selected tool. Use this option always in combination with "-t" |
3.2. Settings
| Automatic Version Check | Enable/Disable the Automatic Version check functionality. It is used to see, if a newe rversion is available. To achieve this, a text file with the newest version number is downloaded from www.spoerr.org. |
| Highlight mandatory options | When enabled, all mandatory Tool options are highlighted in the Tool Settings. |
| For future use | For future use |
| Settings Font | Font Settings for the Tools Settings window. |
4. ConfigMaker
With this tool you can generate configuration files in a fast and easy way. To achieve this, two files are needed: A Template and a Data file. The variable parts are represented by a placeholder like $var in the Template. The data file includes the placeholder names and appendant values.
The output can be stored in two ways:
4.1. Data File Format
If the file is generated with MS Excel and line breaks within a cell are used, please check the "non-standard format" Checkbox. In this case, all "sub-linebreaks" are replaced by " // " and the existing Data file is overwritten with the new data to get compliant with the tool.
If you use Linux, line breaks within cells are not supported, since LF is used for all line breaks. In Windows, line breaks within Cells are marked with LF, while "global" line breaks are marked with CRLF.
4.1.1. Data File enhancements
4.1.1.1. non-standard format
Sometimes it is needed that Line breaks within cells are used in Excel sheets. In this case the line breaks are converted into csv with a LF character. A line break at the end of a line is specified with CR/LF. The LF onlys are now replaced with the string specified at the "Replace LF" option.
4.1.1.2. Flexible Data File
In this case the LFs described under 4.1.1.1. are used to seperate data entries. Each entry is only used once. For an example see the Tutorials at www.spoerr.org/wktools.
4.1.1.3. Use Tags
Tags are specified with two beginning placeholder identifiers - i.e. $$n. With tags you can add Linebreaks or copy entries several times. To get an idea when to use this option (in conjunction with 4.1.1.2.) is, when generating Firewall object-groups where the number of entries could vary for each device.
Possible tags ($ is used in this example as placeholder indentifier):
4.1.2. Simple Example
Data and placeholders in tabular format:
| $hostname | $lip | $dlci | $sip |
| host1 | 10.1.1.1 | 100 | 10.1.2.1 |
| host2 | 10.2.1.1 | 101 | 10.2.2.1 |
| host3 | 10.3.1.1 | 102 | 10.3.2.1 |
Needed format:
$hostname;$lip;$dlci;$sip
host1;10.1.1.1;100;10.1.2.1
host2;10.2.1.1;101;10.2.2.1
host3;10.3.1.1;102;10.3.2.1
NOTE: This example also applies to the scenario when "Use Seperator as Placeholder End" option is used.
4.2. Format of the Template File
Placeholders must be seperated by the text with one of the following chars: CR SPACE /,.;:_-\|()[]{}<>
This statement is false when using the "Use Seperator as Placeholder End" option.
4.2.1. Example
hostname $hostname
!
interface Loopback0
ip address $lip 255.255.255.0
no shutdown
!
interface Serial0.$dlci point-to-point
ip address $sip 255.255.255.252
frame-relay interface-dlci $dlci IETF
!
...
4.2.2. Example when using "Use Seperator as Placeholder End" option
Additional Seperator: ";"
hostname $hostname;
!
interface Loopback0
ip address $lip; 255.255.255.0
no shutdown
!
interface Serial0.$dlci; point-to-point
ip address $sip; 255.255.255.252
frame-relay interface-dlci $dlci; IETF
!
...
4.3. ConfigMaker Settings
| Data File | See 4.1 for more information and format guidelines. |
| Non-standard format checkbox | Use this option when the Data file is generated with MS Excel and line breaks within cells are used. |
| Flexible Data File | Use in case when one cell has more than one data element. See 4.1.1.2 for more information. |
| Use Tags | Tags are used in the config file and the tags are defined in the data file. See 4.1.1.3 for a list of available tags and guidelines. |
| Replace LF | Replace line breaks within cells in the data file with this string. |
| Config File | See 4.2 (Template File) for more information. |
| Log File | Not used at this time |
| Output Directory | The directory where the result should be stored |
| Cycle Count | Used to specify how often the replacement loop should run. Default is "1". Only needed when using Tags. |
| Filename Variable |
The value of this placeholder will be taken as filename for the output file.
Additional characters can be added to the variable as fix parts of the filename i.e. ->
variable is "$hostname", the seperator is ";" and the filename variable sould be
"$hostname;bla". In this case "bla" is added to each filename. NOTE: "Use Seperator as Placeholder End" must be checked if characters are added to the filename. |
| Additional Seperator | This char is used as seperator in the Data File |
| Use Seperator as Placeholder End |
Use this option if there is no special character (see 4.2) between placeholder and data. Example: Placeholder: $test Template: $testTEXT In this case it is not possible to identify the placeholder. With this option all the placeholders have the same ending char - the "Additional Seperator" Example: $test;TEXT Now the $test; placeholder can be identified and replaced by the data. Result (data for $test = 1234): 1234TEXT |
| Modus | The result will be stored in one file or in seperate files. Select your choice. |
| Append Output if.... | If the output file already exists, the file will be replaced or the new output will be appended |
5. Configure Devices
With this tool you can automatically configure Cisco IOS, CatOS and PIXOS devices. Aside these boxes also Linux with the following prompt ending is supported: "$ ".
The supported protocols are Telnet, SSHv2, HTTP+S and Serial Console. This protocols can be combined with one of the following connection types:
Note: MultiHop: Don't forget "exit" at the end of the configuration file, because it is not sent per default!
When using the serial console, only MultiHop is supported, since one of the COM Ports is used as first Hop from which all others are configured.
When using HTTP or HTTPS, all output is saved in a file. The config file must contain the urls to request. When using an empty config file, "ip-address/" is downloaded and saved. At this time only one URL is supported. If you cannot live with this limitation, please smend me an email.
If there are "show" commands in the configuration, the output is stored in a file. The filename is either the Hostname or the IP address of the device. It's also possible to save the whole output in one file.
Note: "show" must be written out in full! Otherwise the output will not be saved.
The devices can have different configuration files and/or Username/Passwords. For different Usernames/Passwords there are two possible methods:
| Less or equal three different Usernames/Passwords |
|
| More than three different Usernames/Passwords |
|
Software upgrade for IOS devices is supported. The configuration file must include the following lines:
copy tftp flash:
1.1.1.1
test.bin
test.bin
5.1. DeviceGroup File
With Version 3.1 a new feature was added: Device Groups. This feature allows you to define the whole dynamic information within one csv file. If the DeviceGroup file is not specified, the Tool generates its own file. The information used to configure the devices is displayed in the Tool specific outout window. The data format is a List. In front of each entry is a checkbox to select the Hosts for the next run - only checked lines are used.
Each entry in the list can be edited and new lines can be added. The information provided in the list is the data basis for configuring the devices. The list is temporarily stored in "tempDevGroup.txt".
The Configuration File can be viewed by right clicking the config file name in the Device Group and using the "Show Config File" option in the popup menu.
If the Device Group data is generated by the tool, the settings in the "Settings Tab" change to "Use Device Groups" and the temporary DeviceGroup File is added to the Settings Panel.
Note: The first element in the table must be checked when using MultiHop. The used protocol in all lines must be the same for Multihop. The used protocol for connections from the first device is specified under "Multihop Command" setting.
5.1.1. DeviceGroup File Format
| Checkbox state | "x" for checked; leave blank for unchecked |
| Hostname | IP Address or DNS name |
| Username | Username |
| Login Password | Login Password |
| Enable Password | Enable Password |
| Config file | Config File to use |
| Protocol |
|
| Port | Port where Service is available at remote host |
| Terminal Server | Terminal Server Options |
| Multihop command | When using Multihop, then this command should be used to get to the next IP Address |
| Remark | Column for Remarks. They have no consequences for the configuration sequence and are only for helping the user interpreting the lines. |
5.1.2. Example
x;1.1.1.1;user1;lopw1;enpw1;conf1.txt;Telnet;;;telnet $ip;host1;
x;1.1.1.2;user2;lopw2;enpw2;conf2.txt;COM1;;;telnet $ip;host2;
x;1.1.1.3;user3;lopw3;;conf3.txt;SSHv1;;;telnet $ip;host3;
x;1.1.1.4;user4;lopw4;enpw4;conf3.txt;SSHv2;;;telnet $ip;host4;
x;1.1.1.5;user5;lopw5;enpw5;conf5.txt;Telnet;;;telnet $ip;host5;
5.2. IP Address File Format
5.2.1. Example
1.1.1.1; host1
2.2.2.2;
3.3.3.3; host3
5.3. Configuration File
5.3.1. Example of a config file with dynamic Username/Password
!user = username -> Username
!lopw = login password -> Login Password
!enpw = enable password -> enable Password
!
conf term
logging buff 8000
exit
wr
show run -> running configuration will be stored in file
show version -> show version output will be stored in file
exit
5.4. Configure Devices Settings
5.4.1. DeviceGroup Settings
| Use Device Groups Checkbox | Use Device Group File (csv) instead of the settings below |
| DeviceGroup File | csv File to use |
5.4.2. Host & ConfigFile Settings
| Host File | See 5.2 for more information. |
| Config File | See 5.3 for more information. |
| Config File Option |
|
| dyn Config Folder | The folder where all specific configuration files are saved. |
| default Configuration File | The default configuration File. This configuration is used when no specific configuration is found. |
| File extension | The extension for the specific config files. Keep this field empty if there is no extension. Don't forget the dot (.) |
5.4.3. User/Password Settings
| Username | Username to access the devices |
| Login Password | Login Password to access the devices |
| Enable Password | Enable Password to access the devices |
| Visible Checkbox | Check, if you want to hide the entered values |
| Dynamic PW Checkbox | Check, if you want to use dynamic Username/Passwords. If checked, the Username/Passwords are specified in the beginning of each config file. |
For more information on how to use more than one Username/Password, please refer to 5.
5.4.4. Connection Settings
| Modus | Protocol to use |
| Type | SingelHop or MultiHop. See 5 for more information. |
| Telnet/SSH/HTTP/COM Port | Port, where remote service is running on server side. In case of Modus COMx, it defines the COM Port. Leave empty if standard ports should be used. |
| Terminal Server Connection |
Three options:
|
| Multihop Command |
Command to use when hopping from the first device to the next. Example: "telnet" OR "ssh -c des" It is possible to have a command where the IP address is not at the end. Example: telnet 1.1.1.1 23. In this case the variable $ip is used. Example: "telnet $ip 23" or "telnet $ip:23" |
5.4.5. Output Settings
| Show Output |
Specify the filename type for the show output - See 5
|
| Show Filename Pattern | Addition to Show Output: The specified characters are added between hostname/IP address and date. |
| Append Checkbox | If unchecked, override an existing file. |
| Logfile | Only used in CLI mode with "-S" option. If you need to save the output in GUI mode, please use the SAVE Toolbar button. Then the whol Log windows output will be saved to the a file. |
| Output Directory | The directory where all "show" files are stored. |
5.4.6. Advanced Settings
| Exec Mode |
what should be sent at login Mode (router>)?
Default: "enable" |
| Wait for Reply Checkbox |
Note: Don't disable this option, if you don't have a special need!
The program waits for a reply (#) from the device before the next command is sent. Sometimes it is useful to disable this behaviour. For example when configuring a banner message. In this case the device does not send a # before the break character is sent. The better way to send commands to the remote host, where no "#" is sent back as reply, is to use the !PARAGRAPH marker in the config. Please refer to 5.5 for more infos. There is a second way to disable "Wait for reply" temporarily: Use !BEGINBLOCK and !ENDBLOCK markers in the configuration file. At !BEGINBLOCK waiting is disabled and at !ENDBLOCK waiting is enabled again. The commands are placed between these two markers. |
| Configure "looging sync" Checkbox | Check, if you want to configure "logging sync" at all vty lines. This is useful to parse the error messages from an IOS device. Please refer to Cisco IOS Command reference for more information on this command. |
| Command in case of wrong password |
There are two choices in case of a wrong enable password:
|
5.4.7. Debug Options
Used to troubleshoot wktools internals.5.5. Special Config Tags
There are some tags which could be used in the configuration file for special handling. Some of them were already recognized above. Here is a complete list of them:| "!user = " | Username can be specified for use with dynamic Username and Passwords |
| "!lopw = " | Login Password can be specified |
| "!enpw = | Login Password can be specified |
| "!BEGINBLOCK" | Begin not to wait for # befor sending the next command |
| "!ENDBLOCK" | End not to wait for # befor sending the next command |
| "!PARAGRAPH" | Everything between two "!PARAGRAPH" statements will be sent at once ->
no need to wait for # and no need to use "BEGINBLOCK" and "!ENDBLOCK". This is the preferred method when banners or templates or similar things are configured with wktools. |
| "!CTRL+SHIFT+6 X" | Send Ctrl+Shift+6 x. Useful for connections with a terminal server |
| "show" | Collect every returning traffic and store it in a file until the next command is sent. |
| "!LOG" | It's working like "show" but for the next command in the config file. |
| "!CRLF" | Sends a CR/LF to the remote host. |
6. IP List
Use this tool to search configuration files in a directory, including sub directories, for IP addresses of a specified Interface. The result will be stored in a file.
The files to search can be restricted using search patterns for the file name.
6.1. IP List Settings
| Directory to search | Folder, including sub Folders, which will be searched for configuration files. |
| Output Directory | The directory where the result is stored. |
| Interface | The name of the Interface of which the IP address should be searched. |
| Interface Number | Interface Number of the previously defined interface. |
| Search Patterns |
|
| Modus | The result will be stored in one file or in seperate files. |
| Append Output if.... | If the output file already exists, the file will be replaced or the new output will be appended |
7. Device Information Parser
This tool parses text files with show output from Cisco devices. Currently there are two parser implemented:7.1. Inventory Parser
With this Parser you can easily do an inventory of your installed base of Cisco devices.The following information is collected and saved as csv:7.1.1. Supported Devices
Since nearly every Cisco device has different show commands and format for the output, not all devices are supported. At this time it is tested with the following hardware:7.1.1.1. Cisco Router
7.1.1.2. Cisco Switches
7.1.1.3. Cisco Other
It may work for other IOS or CatOS hardware but there is no guarantee for it. If you have problems with any kind of IOS/CatOS hardware please send an email to wktools@spoerr.org.
7.1.1. Format of the file to parse
When the data is collected, the following template must be used, even if some of the commands are not supported by some or all devices. If the template is not used, the result is unspecified. If you use wktools to collect the data, you may use the "Inventory" Config Option.7.1.2.1. Template for all devices except 6200 DSLAMs
show ver ! Version Information
show snmp ! Location Information
show module ! Module Information for CatOS Devices
show c7200 ! NPE Information for 7200 routers
show diag ! Module Information for IOS devices
show invent ! Module and Chassis Information for IOS devices
show hardware ! Module Information for LS1010 devices
show system ! Powersupply Information for CatOS devices
show file system ! File system Information for getting flash sizes
exit
7.1.2.2. Template for 6200 DSLAMs
show ver
show harware chassis
show hardware
show hardware slot x ! where x is the Slotnumber (Information for all Slots should be collected)
exit
7.1.2.3. Cisco IP Phones
The information for IP Phones is collected with http or https. Only the main page is needed (ip-address/).7.2. Interface Information Parser
With this Parser you can collect interface status information like sent/received Packets or Bytes or Interface errors. At this time only IOS devices (routers and switches) are supported.
The output will be comma seperated file (.csv) with ";" as seperators.
The information the parser uses to collect the statistics is from "show version" and "show interfaces" output. The output of each device has to be stored in a seperate file and the output of both commands must be collected. Otherwise the Parser will fail.
7.3. GUI explanation
|
Search Directory |
Folder, not including sub Folders, which will be searched for configuration files |
|
Search Patterns |
|
|
Output Directory |
The directory where the result should be stored |
|
Output File Name |
The name of the csv file |
|
Append |
If the output file already exists, the file will be replaced or the new output will be appended |
| SNMP Location columns | The number of the SNMP location columns. This feature can be used to read csv information in the snmp location. Sometimes there are ";" used in snmp locations. If this is the case, specify the number of ";" +1 in this option => minimum is 1. This option is only available for the Inventory Parser. |
| Only collect chassis information | Only one line per device is added to the output file. This line includes the chassis information like S/N, memory, Version... |
| Show the following columns | Uncheck the Column you do not want to have in your output. This option is only available for the Inventory Parser. |
| Don't collect Interface Descriptions | This option should be used if you have ";" in your Interface Descriptions. If ";" are used,
the output would be shifted because a ";" is used as indicator for a new column. This option is only available for the Interface Parser. |
8. Scheduler