diff --git a/.gitignore b/.gitignore index eaf3840..49da146 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,10 @@ src/merakicat/batch_helper_preview.json src/merakicat/test.txt +# BBEdit files +*.bbprojectd +*.bbnotebookd + # App-created files and logs files/*.cfg files/*.pdf diff --git a/AUTHORS.rst b/AUTHORS.rst index c65f04b..e9868be 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -9,7 +9,4 @@ Ed Coen Based on Work by ---------------- * Fady Sharobeem - -* Hank Preston -* Josh Anderson -* Oleksii Borisenko +* Finbarr Brady diff --git a/HISTORY.md b/HISTORY.md index 8655e77..fd59204 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,11 @@ # History +## 0.2.4 (04-12-2024) + + - Added Private VLAN -> Port Isolation to encyclopedia. + - Removed older bot code. + - Updated AUTHORS.rst. + ## 0.2.3 (04-10-2024) - Translate now checks to make sure that the target switches have the same number of ports as the sources. @@ -49,46 +55,46 @@ - Setting up for publishing automation. - Changed directory structure for publishing. - Released on PyPI. - + ## 0.0.14 (03-19-2024) - Option added for check with drag and drop files in bot mode. - Added missing timing in check report in bot mode. - Still not yet released on PyPI. - + ## 0.0.13 (03-18-2024) - Option added for detailed check report "with detail". - + ## 0.0.12 (03-15-2024) - Option for PDF vs. DOCX reporting in checker. - Layer 3 Interfaces (interface VLAN) supported. - Static routes supported. - Command added for "demo report". - + ## 0.0.11 (03-12-2024) - New reporting in checker. - Port-channel LACP is working and fast. - + ## 0.0.10 (03-08-2024) - Using a single mc_pedia. - + ## 0.0.9 (03-07-2024) - Using both config_pedia and check_pedia. - Changed to ngrok API for bot functionality - + ## 0.0.8 (03-01-2024) - Lots of comment blocks added. - + ## 0.0.7 (03-01-2024) - Now using batch port updates to Meraki dashboard. - + ## 0.0.6 (03-01-2024) - Some light refactoring of mc_translate module. diff --git a/src/merakicat/mc_pedia.py b/src/merakicat/mc_pedia.py index b94ebe8..eedac08 100755 --- a/src/merakicat/mc_pedia.py +++ b/src/merakicat/mc_pedia.py @@ -67,11 +67,11 @@ mc_pedia = { - 'version': "v0.1.6", - 'dated': "04/10/2024", + 'version': "v0.1.7", + 'dated': "04/12/2024", 'switch': { - + 'switch_name': { 'name': "Hostname", 'support':"✓", @@ -88,7 +88,7 @@ host_name = switch_name\n\ if debug:\n\ print(f'switch_name = {switch_name}')\n", - + 'meraki': { 'skip': 'post_process', 'default': 'Auto negotiate', @@ -151,7 +151,7 @@ print(f'dir() = {dir()}')\n" } }, - + 'vtp':{ 'name': "VTP", 'support':"", @@ -164,7 +164,7 @@ 'url':"https://documentation.meraki.com/MS/Port_and_VLAN_Configuration/Integrating_the_MS_Access_Switch_into_a_Cisco_VTP_domain", 'note':"Not required" }, - + 'mls':{ 'name': "QoS", 'support':"✓", @@ -177,7 +177,7 @@ 'url':"https://documentation.meraki.com/MS/Other_Topics/MS_Switch_Quality_of_Service_Defined", 'note':"Network-wide" }, - + 'rstp':{ 'name':"Spanning Tree RSTP", 'support':"✓", @@ -188,7 +188,7 @@ }, 'iosxe': "rstp = parse.find_objects('^spanning-tree mode rapid-pvst')\n" }, - + 'spanning':{ 'name':"Spanning Tree", 'support':"", @@ -205,7 +205,7 @@ 'url':"https://documentation.meraki.com/MS/Port_and_VLAN_Configuration/Configuring_Spanning_Tree_on_Meraki_Switches_(MS)", 'note':"Only Supports RSTP" }, - + 'snmp':{ 'name': "SNMP", 'support':"", @@ -218,7 +218,7 @@ 'url': "https://documentation.meraki.com/General_Administration/Monitoring_and_Reporting/SNMP_Overview_and_Configuration", 'note': "Configured network-wide" }, - + 'logging_host':{ 'name': "Syslog", 'support':"", @@ -231,7 +231,7 @@ 'url': "https://documentation.meraki.com/General_Administration/Monitoring_and_Reporting/Syslog_Server_Overview_and_Configuration", 'note': "Configured network-wide" }, - + 'ntp':{ 'name':"NTP", 'support':"", @@ -244,7 +244,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Configured by default" }, - + 'access_list':{ 'name': "Access-List", 'support':"", @@ -257,7 +257,7 @@ 'url':"https://documentation.meraki.com/MS/Access_Control/Meraki_MS_Group_Policy_Access_Control_Lists", 'note':"Group Policies" }, - + 'extended_access_list':{ 'name': "Extended ACL", 'support':"", @@ -270,7 +270,7 @@ 'url':"https://documentation.meraki.com/MS/Access_Control/Meraki_MS_Group_Policy_Access_Control_Lists", 'note':"Group Policies" }, - + 'port_mirror':{ 'name': "Port mirroring", 'support': "✓", @@ -281,7 +281,7 @@ }, 'iosxe': "port_mirror = parse.find_objects('^monitor')\n" }, - + 'aaa':{ 'name': "AAA", 'support':"", @@ -294,7 +294,7 @@ 'url':"https://documentation.meraki.com/General_Administration/Managing_Dashboard_Access/Managing_Dashboard_Administrators_and_Permissions", 'note':"Built in Meraki dashboard" }, - + 'dot1x':{ 'name': "802.1x", 'support': "✓", @@ -307,7 +307,7 @@ 'url':"https://documentation.meraki.com/MS/Access_Control/MS_Switch_Access_Policies_(802.1X)", 'note':"Network-wide" }, - + 'netflow':{ 'name': "NetFlow", 'support':"✓", @@ -320,7 +320,7 @@ 'url':"https://documentation.meraki.com/MS/Monitoring_and_Reporting/MS_NetFlow_and_Encrypted_Traffic_Analytics", 'note':"Network-wide" }, - + 'dhcp':{ 'name':"DHCP server", 'support':"✓", @@ -331,7 +331,7 @@ }, 'iosxe':"dhcp = parse.find_objects('^ip\sdhcp\spool')\n" }, - + 'banner':{ 'name': "Banner", 'support':"", @@ -344,7 +344,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not required" }, - + 'radius':{ 'name':"Radius", 'support':"✓", @@ -355,7 +355,7 @@ }, 'iosxe':"radius = parse.find_objects('^radius-server|^radius\sserver')\n" }, - + 'http_server':{ 'name': "HTTP server", 'support':"", @@ -368,7 +368,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not required" }, - + 'stack':{ 'name': "Stack", 'support':"✓", @@ -382,7 +382,7 @@ if len(stack) == 1:\n\ stack = []\n" }, - + 'mab_vlan_mac':{ 'name': "MAB VLAN MAC Auth", 'support':"", @@ -395,7 +395,7 @@ 'url':"https://documentation.meraki.com/MS/Access_Control/MS_Switch_Access_Policies_(802.1X)", 'note':"MAB with RADIUS is supported" }, - + 'vlan':{ 'name': "Layer 2 VLAN", 'support':"", @@ -408,7 +408,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Configured by default" }, - + 'vmps':{ 'name': "VMPS", 'support':"", @@ -421,7 +421,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported as it is dated technology" }, - + 'uplinkfast':{ 'name': "STP Uplinkfast", 'support':"", @@ -434,7 +434,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'backbonefast':{ 'name': "STP Backbonefast", 'support':"", @@ -447,7 +447,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'loopguard':{ 'name': "STP Loopguard", 'support':"", @@ -459,7 +459,7 @@ 'iosxe': "loopguard = parse.find_objects('spanning-tree\sloopguard')\n", 'note':"Supported at the port level" }, - + 'dhcp_snooping':{ 'name': "DHCP Snooping", 'support':"✓", @@ -472,7 +472,7 @@ 'url':"https://documentation.meraki.com/MS/Other_Topics/Dynamic_ARP_Inspection", 'note':"Network-wide" }, - + 'ip_source_guard':{ 'name': "IP Source Binding", 'support':"", @@ -483,7 +483,7 @@ }, 'iosxe': "ip_source_guard = parse.find_objects('ip\ssource\sbinding')\n" }, - + 'arp_inspection':{ 'name': "ARP Inspection", 'support':"✓", @@ -496,7 +496,7 @@ 'url':"https://documentation.meraki.com/MS/Other_Topics/Dynamic_ARP_Inspection", 'note':"Network-wide" }, - + 'arp_acl':{ 'name': "ARP Access-list", 'support':"", @@ -509,7 +509,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'psp':{ 'name': "Protocol Storm Protection", 'support':"", @@ -522,7 +522,7 @@ 'url': "https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'udld':{ 'name': "UDLD", 'support':"", @@ -534,7 +534,7 @@ 'iosxe': "udld = parse.find_objects('^udld')\n", 'note':"Supported at the port level" }, - + 'logging':{ 'name': "Logging", 'support':"", @@ -547,7 +547,7 @@ 'url': "https://documentation.meraki.com/General_Administration/Cross-Platform_Content/Meraki_Event_Log", 'note':"Configured by default" }, - + 'ip_sla':{ 'name': "IP SLA", 'support':"", @@ -560,7 +560,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'multicast_igmp':{ 'name': "Multicast IGMP", 'support':"", @@ -573,7 +573,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Configured by default" }, - + 'multicast_pim':{ 'name': "Multicast PIM", 'support':"✓", @@ -584,7 +584,7 @@ }, 'iosxe': "multicast_pim = parse.find_objects('^ip\spim')\n" }, - + 'static_routing':{ 'name': "Static routing", 'support':"✓", @@ -623,7 +623,7 @@ dashboard.switch.createDeviceSwitchRoutingStaticRoute(swlist[0],route['subnet'],route['gw'])\n" } }, - + 'ipv6':{ 'name': "IPv6", 'support':"✓", @@ -634,7 +634,7 @@ }, 'iosxe': "ipv6 = parse.find_objects('^ipv6')\n" }, - + 'rip':{ 'name': "RIP", 'support':"", @@ -647,7 +647,7 @@ 'url':"https://documentation.meraki.com/MS/Layer_3_Switching/MS_Layer_3_Switching_and_Routing", 'note':"Not Supported" }, - + 'eigrp':{ 'name': "EIGRP", 'support':"", @@ -660,7 +660,7 @@ 'url':"https://documentation.meraki.com/MS/Layer_3_Switching/MS_Layer_3_Switching_and_Routing", 'note':"Not Supported" }, - + 'ospf':{ 'name': "OSPFv2", 'support':"✓", @@ -673,7 +673,7 @@ 'url':"https://documentation.meraki.com/MS/Layer_3_Switching/MS_Layer_3_Switching_and_Routing", 'note':"Supported on MS250 and above" }, - + 'ospfv3':{ 'name': "OSPFv3", 'support':"", @@ -686,7 +686,7 @@ 'url':"https://documentation.meraki.com/MS/Layer_3_Switching/MS_Layer_3_Switching_and_Routing", 'note':"Not Supported" }, - + 'bgp':{ 'name': "BGP", 'support':"", @@ -699,7 +699,7 @@ 'url':"https://documentation.meraki.com/MX/Networks_and_Routing/Border_Gateway_Protocol_(BGP)", 'note':"Currently supported on MX only" }, - + 'isis':{ 'name': "IS-IS", 'support':"", @@ -712,7 +712,7 @@ 'url':"https://documentation.meraki.com/MS/Layer_3_Switching/MS_Layer_3_Switching_and_Routing", 'note':"Not Supported" }, - + 'vrf': { 'name': "VRF", 'support':"", @@ -726,9 +726,9 @@ 'note':"Not Supported" } }, - + 'port': { - + 'name': { 'name': "Port Description", 'support':"✓", @@ -740,7 +740,7 @@ }, 'iosxe': "name = child.re_match_typed(regex=r'\sdescription\s+(\S.+)')\n" }, - + 'active': { 'name': "Port Status", 'support':"✓", @@ -754,7 +754,7 @@ shut = child.re_match_typed(regex=r'\s(shutdown)')\n\ active = 'true' if shut == '' else 'false'\n" }, - + 'speed': { 'name': "Port Speed", 'support':"✓", @@ -766,7 +766,7 @@ }, 'iosxe': "speed = child.re_match_typed(regex=r'\sspeed\s+(\S.*)')\n" }, - + 'duplex': { 'name': "Port Duplex", 'support':"✓", @@ -777,9 +777,9 @@ 'default': '' }, 'iosxe': "duplex = child.re_match_typed(regex=r'\sduplex\s+(\S.+)')\n",\ - + }, - + 'linkNegotiation': { 'iosxe': "", 'regex': '', @@ -808,19 +808,20 @@ linkNegotiation = 'Auto negotiate'\n" } }, - + 'type': { 'name': "Port Type", 'support':"✓", 'translatable':"✓", - 'regex': r'\sswitchport\smode\s+(\S.+)', + 'regex': r'\sswitchport\smode(?:\s\S+-\S+)?\s(access|trunk|host)', 'meraki': { 'skip': False, 'default': 'trunk' }, - 'iosxe': "type = child.re_match_typed(regex=r'\sswitchport\smode\s+(\S.+)')\n" + 'iosxe': "type = child.re_match_typed(regex=r'\sswitchport\smode(?:\s\S+-\S+)?\s(access|trunk|host)')\n\ +type = 'access' if type == 'host' else type\n" }, - + 'poeEnabled': { 'name': "PoE Enabled", 'support':"✓", @@ -833,7 +834,7 @@ }, 'iosxe': "poeEnabled = not child.re_match_typed(regex=r'\spower\sinline\s+(\S.+)')=='never'\n" }, - + 'allowedVlans': { 'name': "Allowed VLANs", 'support':"✓", @@ -845,7 +846,7 @@ }, 'iosxe': "allowedVlans = child.re_match_typed(regex=r'\sswitchport\strunk\sallowed\svlan\s+(\S.*)')\n" }, - + 'vlan': { 'name': "Native VLAN", 'support':"✓", @@ -857,7 +858,7 @@ }, 'iosxe': "vlan = child.re_match_typed(regex=r'\sswitchport\strunk\snative\svlan\s+(\S.*)')\n" }, - + 'vlan': { 'name': "Data VLAN", 'support':"✓", @@ -869,7 +870,7 @@ }, 'iosxe': "vlan = child.re_match_typed(regex=r'\sswitchport\svlan\s+(\S.*)')\n" }, - + 'voiceVlan': { 'name': "Voice VLAN", 'support':"✓", @@ -881,20 +882,21 @@ }, 'iosxe': "voiceVlan = child.re_match_typed(regex=r'\sswitchport\svoice\svlan\s+(\S.*)')\n" }, - - 'private_vlan': { + + 'isolationEnabled': { 'name': "Private VLAN", - 'support':"", - 'translatable':"", + 'support':"✓", + 'translatable':"✓", 'regex': r'\sswitchport\smode\sprivate-vlan?(\S.*)', 'meraki': { - 'skip': True + 'skip': False, + 'default': False }, - 'iosxe': "private_vlan = child.re_match_typed(regex=r'\sswitchport\smode\sprivate-vlan?(\S.*)')\n", + 'iosxe': "isolationEnabled = True if not child.re_match_typed(regex=r'\sswitchport\smode\sprivate-vlan?(\S.*)') == '' else False\n", 'url':"https://documentation.meraki.com/MS/Port_and_VLAN_Configuration/Restricting_Traffic_with_Isolated_Switch_Ports", 'note':"Port Isolation can be used" }, - + 'l3_interface': { 'name': "Layer 3 Interface", 'support':"✓", @@ -948,7 +950,7 @@ }, 'iosxe': "l3_interface = child.re_match_typed(regex=r'\sip\saddress\s(\S.*)')\n" }, - + 'root_guard': { 'name': "STP Root Guard", 'support':"✓", @@ -960,7 +962,7 @@ 'default': '' } }, - + 'loop_guard': { 'name': "STP Loop Guard", 'support':"✓", @@ -972,7 +974,7 @@ 'default': '' } }, - + 'bpdu_guard': { 'name': "STP BPDU Guard", 'support':"✓", @@ -984,7 +986,7 @@ 'default': '' } }, - + 'stpGuard': { 'iosxe': "", 'regex': '', @@ -1013,7 +1015,7 @@ 'default': 'disabled' } }, - + 'pruning': { 'name': "Pruning", 'support':"", @@ -1026,7 +1028,7 @@ 'url':"https://documentation.meraki.com/General_Administration/Tools_and_Troubleshooting/Fundamentals_of_802.1Q_VLAN_Tagging", 'note':"Not required" }, - + 'stp_port': { 'name': "STP Port Priority", 'support':"", @@ -1037,7 +1039,7 @@ }, 'iosxe': "stp_port = child.re_match_typed(regex=r'\sspanning-tree\sport-priority?(\S.*)')\n" }, - + 'portfast': { 'name': "STP Portfast", 'support':"✓", @@ -1050,7 +1052,7 @@ 'url':"https://documentation.meraki.com/MS/Deployment_Guides/Advanced_MS_Setup_Guide", 'note':"Automatic Edge Port" }, - + 'storm_control': { 'name': "Storm Control", 'support':"", @@ -1063,7 +1065,7 @@ 'url':"https://documentation.meraki.com/MS/Other_Topics/Storm_Control_for_MS", 'note':"Configured network-wide" }, - + 'protected': { 'name': "Protected", 'support':"✓", @@ -1076,7 +1078,7 @@ 'url':"https://documentation.meraki.com/MS/Port_and_VLAN_Configuration/Restricting_Traffic_with_Isolated_Switch_Ports", 'note':"Port Isolation" }, - + 'port_security': { 'name': "Port Security", 'support':"✓", @@ -1087,7 +1089,7 @@ }, 'iosxe': "port_security = child.re_match_typed(regex=r'\sswitchport\sport-security?(\S.*)')\n" }, - + 'port_udld': { 'name': "Port UDLD", 'support':"✓", @@ -1098,7 +1100,7 @@ }, 'iosxe': "port_udld = child.re_match_typed(regex=r'\sudld\sport?(\S.*)')\n" }, - + 'lldp': { 'name': "LLDP", 'support':"", @@ -1111,7 +1113,7 @@ 'url':"https://documentation.meraki.com/General_Administration/Other_Topics/LLDP_Support_on_Cisco_Meraki_Products#ms", 'note':"Always on" }, - + 'ipv6': { 'name': "IPv6", 'support':"", @@ -1124,7 +1126,7 @@ 'url':"https://documentation.meraki.com/MS", 'note':"Not Supported" }, - + 'directed_broadcast': { 'name': "IP Directed Broadcast", 'support':"", @@ -1135,7 +1137,7 @@ }, 'iosxe': "directed_broadcast = child.re_match_typed(regex=r'\sip\sdirected-broadcast?(\S.*)')\n" }, - + 'etherchannel_cisco': { 'name': "Etherchannel Classic", 'support':"", @@ -1148,7 +1150,7 @@ 'url':"https://documentation.meraki.com/General_Administration/Tools_and_Troubleshooting/Link_Aggregation_and_Load_Balancing", 'note':"Only LACP is supported" }, - + 'etherchannel_pagp': { 'name': "Etherchannel PAgP", 'support':"", @@ -1161,7 +1163,7 @@ 'url':"https://documentation.meraki.com/General_Administration/Tools_and_Troubleshooting/Link_Aggregation_and_Load_Balancing", 'note':"Only LACP is supported" }, - + 'etherchannel_lacp': { 'name': "Etherchannel LACP", 'support':"✓", @@ -1172,7 +1174,7 @@ }, 'iosxe': "etherchannel_lacp = child.re_match_typed('^\schannel-group\s(\d+)')\n" }, - + 'etherchannel': { 'iosxe': "", 'regex': '', @@ -1260,7 +1262,7 @@ } }, 'layer3': { - + 'interfaceIp': { 'iosxe': "", 'regex': '', @@ -1274,7 +1276,7 @@ interfaceIp = re.findall(r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}', intf_settings['l3_interface'])[0]\n" } }, - + 'subnet': { 'iosxe': "", 'regex': '', @@ -1564,9 +1566,9 @@ def index_mc_pedia(index_args): blurb = "\n\n\ ==============================\n\ Index of mc_pedia\n" - + if len(index_args) == 0: - blurb+=" All Reportable Items\n" + blurb+=" All Reportable Items\n" elif "support" in index_args: if "translatable" in index_args: blurb+="Supported & Translatable Items\n" diff --git a/src/merakicat/mc_user_info.py b/src/merakicat/mc_user_info.py index e2e13f7..3d22fef 100644 --- a/src/merakicat/mc_user_info.py +++ b/src/merakicat/mc_user_info.py @@ -17,13 +17,13 @@ # IOS_SECRET = "secret" # IOS_PORT = 22 -# Webex Teams Bot Access Token for this Bot +# Webex Teams Bot Access Token for this Bot # TEAMS_BOT_TOKEN = "ZTZjMDc5ZTUtN2Q5NS00NzNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN2_PF84_1eb65fdf-9643-417f-9974-ad72cae0e10f" -# Webex Teams Bot email address for this Bot +# Webex Teams Bot email address for this Bot # TEAMS_BOT_EMAIL = "mybot@webex.bot" -# Webex Teams Bot email address for this Bot +# Webex Teams Bot email address for this Bot # TEAMS_BOT_APP_NAME = "My Bot" # Webex Teams user email who can access our bot diff --git a/src/merakicat/merakicat.py b/src/merakicat/merakicat.py index 7fa8992..3991df8 100755 --- a/src/merakicat/merakicat.py +++ b/src/merakicat/merakicat.py @@ -293,7 +293,7 @@ def execute(self, message, attachment_actions, activity): try: raw_nets = dashboard.organizations.getOrganizationNetworks( organizationId=meraki_orgs[x]['id']) - + except meraki.exceptions.APIError: print("We were unable to get the list of networks" + f" for {meraki_orgs[x]['name']}.") @@ -340,9 +340,6 @@ def execute(self, message, attachment_actions, activity): sys.exit() # Create a Bot Object - # Note: debug mode prints out more details about processing to terminal - # Note: the `approved_users=approved_users` line commented out and shown - # as reference # # Example: How to limit the approved Webex Teams accounts for interaction # List of email accounts of approved users to talk with the bot @@ -353,21 +350,6 @@ def execute(self, message, attachment_actions, activity): if debug: print(f"teams_emails = {teams_emails}") - """ - bot = TeamsBot( - bot_app_name, - teams_bot_token=teams_token, - teams_bot_url=bot_url, - teams_bot_email=bot_email, - debug=debug, - # Comment out the approved_users lines if you don't care... - approved_users=teams_emails, - webhook_resource_event=[ - {"resource": "messages", "event": "created"}, - {"resource": "attachmentActions", "event": "created"}, - ], - ) - """ bot = WebexBot( teams_token, bot_name=bot_app_name, @@ -380,8 +362,6 @@ def execute(self, message, attachment_actions, activity): log_level="ERROR" ) - - # Create a custom bot greeting function, returned when no /command is given. # The default behavior of the bot is to return the '/help' command response # If there is an English language command line, try to work with that. @@ -413,6 +393,7 @@ def greeting(incoming_msg): user_text = user_text.split(bot_fname + ' ', 1)[1] if debug: + print(f"user_text = {user_text}") print(f"command = {command}") # If the user asked for timing, we will try to give it to them @@ -1303,7 +1284,7 @@ def cloud_switch(incoming_msg, host=""): # Import the global stateful variables global host_id, times - # Since we weren't passed a config filespec, check for a hostname or + # Since we weren't passed a config filespec, check for a hostname or # IP address if host == "": return ("You need to enter a host FQDN or IP address.") @@ -2173,57 +2154,6 @@ def create_message_with_attachment(rid, msgtxt, attachment): "Create a demo report for all features currently in the feature \ encyclopedia"]]) - """ - bot.add_command("help", "This list of commands", greeting) - - bot.add_command("check [host _FQDN or IP address_ | file _filespec_] \ -[with timing] [with details]", - "Check a Catalyst switch config for both translatable \ -and possible Meraki features", - greeting) - - bot.add_command("check _drag-and-drop files_ [with timing] [with details]\ -", - "Check one or more Catalyst switch config files for both \ -translatable and possible Meraki features", - greeting) - - bot.add_command("check [network _Meraki network_] [with timing] \ -[with details]", - "Check the configs of cloud monitored Catalyst switches \ -for both translatable and possible Meraki features", - greeting) - - bot.add_command("register [host _FQDN or IP address_] [with timing]", - "Register a Catalyst switch to the Meraki Dashboard", - greeting) - - bot.add_command("claim [_Meraki serial numbers_] [to _Meraki network \ -name_] [with timing]", - "Claim Catalyst switches to a Meraki Network", - greeting) - - bot.add_command("translate [host _FQDN or IP address_ | file _filespec_] \ -[to _Meraki serial numbers_] [with timing]", - "Translate a Catalyst switch config from a file or host \ -to claimed Meraki serial numbers", - greeting) - - bot.add_command("migrate [host _FQDN or IP address_] [to _Meraki network \ -name_] [with timing]", - "Migrate a Catalyst switch to a Meraki switch - register,\ - claim & translate", - greeting) - - bot.add_command("demo report", - "Create a demo report for all features currently in the \ -feature encyclopedia", - greeting) - - # Every bot includes a default "/echo" command. You can remove it, or any - # other command with the remove_command(command) method. - bot.remove_command("/echo") - """ bot.add_command(RunHelp()) bot.add_command(RunCheck()) bot.add_command(RunRegister())