Package: cisco-documentation
cisco-documentationDocumentation Method for Cisco Devices using excel.Requirementspython3 (3.9)pipcisco-documentationInstallationpython3.9-mpipinstallcisco-documentationUpdatingpipinstall--upgrade--upgrade-strategyeagercisco-documentationUsageFor CiscoDocumentationUpdate switch-list.txt with a complete list of switches.Device types supported include cisco_ios (ssh), cisco_ios_telnet (telnet)Cisco s300 will need additional changes before it will work.Optional: Create load-credentials.txt to load the keychain with credentials for all switches.cisco-documentation --load-creds /dir/to/creds.txtRun cisco-documentation.usage:cisco-documentation[-h][--excel-template][--switch-listSWITCH_LIST][--load-credsLOAD_CREDS][--output-dirOUTPUT_DIR][--fetch-info][--parse-info][--update-wireshark-oui][--update-excelUPDATE_EXCEL]optionalarguments:-h,--helpshowthishelpmessageandexit--excel-templateCreatetheexceldocumentationtemplateinthecwd.--switch-listSWITCH_LISTSpecifytheswitchlisttousetocollectdocumentation.--load-credsLOAD_CREDSLoadcredentialsintothekeystorefromthistextdocument.(switch-ip,username,password)--output-dirOUTPUT_DIRSettheoutputdirectoryforswitchconfigs,arptableoutput,etc.--fetch-infoFetchinformationfromtheswitches(outputstoOUTPUT_DIR/output.json)--parse-infoParsesstoredinfofromOUTPUT_DIR/output.jsonandoutputsOUTPUT_DIR/output.csv--update-wireshark-ouiThisupdatesthewiresharkouilisttoidentifyvendorsbasedonthedevicemacaddress.--update-excelUPDATE_EXCELThisisthefilenametoupdatethe'SWITCHES'and'ARP'sheetsofthespecifiedworkbookautomatically.Thisperminentlyerasesthecurrent'SWITCHES'worksheet.Thisonlyappendsvaluestothe'ARP'sheet.For RunCommandsThis is a simple script to run multiple commands on the switches in switch_list.txtNote: RunCommands.py does not use multiprocessing, and RunCommands2.py has not been maintained, but should still be operational.Run python3.9 ./RunCommands.pyEnter commands separated by ~.For example, to configure spanning-tree mode on all switches in switch_list.txt you could runconf t~spanning-tree mode mst~end~wrUpdating the Excel SpreadsheetUpdate the ARP sheet with the output from arp_output.txt. Also add the output from arp-scan if there are devices missing (if a device isn't communicating over the l3 switch, or there is no l3 switch in the network, these devices will not exist in the arp table.)If devices don't communicate over the gateway, their arp entries will not exist on the l3 switch. Using nmap beforehand from a separate subnet will populate the arp table on this switch - assuming devices are properly programed with a default gateway.Copy the output from output.txt into the SWITCHES sheet. This will update formulas used to the right of the output to look up device information from each sheet.Device information should be contained in a sheet named after each l2 network.L2 networks should be named, vlans/ranges assigned on the OVERVIEW sheet.Building and installing from sourcepython3.9-mpipuninstallcisco-documentation-y
rmdist/cisco_documentation-*-py2.py3-none-any.whl
python3.9setup.pybdist_wheel--universal
python3.9-mpipinstalldist/cisco_documentation-*-py2.py3-none-any.whl# To upload to pypitwineuploaddist/*Using an ssh jumphostTo use a jumphost you need to be able to authenticate to the jumphost using an ssh key.Setting up key authentication to a jumphost.Generate your local key.ssh-keygen-trsaCopy the key to the remote server.ssh-copy-iduser@ip.or.dnsSetup the ssh_config file.cat~/.ssh/yourJumpHostConfigFileName
hostjumphostIdentitiesOnlyyesIdentityFile~/.ssh/id_rsaUseruserHostNameip.or.dns

host*!jumphostUseradmin# Force usage of this SSH config fileProxyCommandssh-F~/.ssh/yourJumpHostConfigFileName-W%h:%pjumphost# Alternate solution using netcat#ProxyCommand ssh -F ./ssh_config jumphost nc %h %pRunning the command specifying the ssh-config file.cisco-documentation<yourotheroptionshere>--ssh-config~/.ssh/yourJumpHostConfigFileName
run-commands<yourotheroptionshere>--ssh-config~/.ssh/yourJumpHostConfigFileNameChangelog0.0.11Added processing of cdp for cases where lldp does not show the neighbor.0.0.10Added an option for a local keyring to default to /keyring.json if there are no valid backends. (i.e. ubuntu server default install)Updated formatting to black.Added generic error handling when collecting information sequentially. Failed collection will skip the device in the results.Added option to collect information from a single device. (--switch)Fixed run-commands by adding the default-creds options.0.0.9Added rich to the requirements.Added option to run sequentially instead of in parallel. (--parallel flag)Added function and cli app to help test and save credentials.0.0.8Fixed an over-indentation of the arp table generation causing large files.Changed the arp_output.csv to be tab-delimited for easier copy/paste to excel.0.0.7Added better error handling - still writes to output.json if a single connection fails.Changed section to support fetching cisco specific information via telnet.0.0.6Added config-merge command.Added port-descriptions command.Made additional functions to re-use more code.Added jinja-merge command for templating switch configurations.0.0.5Updated readme to fix some outdated information.Updated the --help to add some context.Updated the wireshark_oui.txt file.Added an option to update the wireshark_oui.txt file.Fixed the get_oui_dict function to return the generated oui_dict.Added a step for creation of arp_output.csv output with the arp information.Removed aiomultiprocess from requirements.Added option to update an excel file directly.