{"id":3903,"date":"2019-11-19T11:00:50","date_gmt":"2019-11-19T11:00:50","guid":{"rendered":"https:\/\/live-infoblox-blog.pantheonsite.io\/?p=3903"},"modified":"2020-05-06T10:26:53","modified_gmt":"2020-05-06T17:26:53","slug":"netmri-scripting-modify-interface","status":"publish","type":"post","link":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/","title":{"rendered":"Modify Cisco interface description on all Trunking Interface"},"content":{"rendered":"<h1>A customer wanted to modify all &#8220;trunking&#8221; interfaces description to add the CDP neighbor name to it.<\/h1>\n<p>Not a problem for NetMRI<\/p>\n<ul>\n<li>We run a show command to get all the Trunking interfaces<\/li>\n<li>Then run another show command to get the CDP details for all the trunking interfaces<\/li>\n<li>Once we have the CDP details, we will parse that looking for the neighbor name and add it to the interface description<\/li>\n<\/ul>\n<p>This script will grab the CDP neighbor&#8217;s name and add it to the interface that it&#8217;s configured on.<br \/>\n<code><br \/>\nScript-Filter:<br \/>\n$vendor eq \"Cisco\" and $sysdescr like \/IOS\/ ####################################################################### #<br \/>\nAction:<br \/>\nExecute Command Batch <\/code><\/p>\n<p>Action-Commands:<br \/>\nsh int trunk | inc trunking<\/p>\n<p>Output-Triggers:<br \/>\nParse Output<br \/>\n####################################################################### #<br \/>\nTrigger:<br \/>\nParse Output<br \/>\nTrigger-Variables:<br \/>\n#This regex finds the interfaces<br \/>\n$cdpport \/((Gi|Fa)+\\d+(\\\/\\d{1,2}|\\\/\\d{1,2}\\\/\\d+|\\\/\\d{1,2}\\.\\d+|\\\/\\d{1,2}\\:\\d+)?|\\w+-\\w+\\d{1,3})\/<br \/>\nTrigger-Template:<br \/>\n[[$cdpport]]\\s.+on\\s.+802.1q\\s.+trunking\\s.+<br \/>\nTrigger-Commands:<br \/>\nsh cdp ne $cdpport<br \/>\nOutput-Triggers:<br \/>\nShow CDP<br \/>\n#################### #<br \/>\nTrigger:<br \/>\nShow CDP<br \/>\nTrigger-Variables:<br \/>\n$cdpname \/\\w.+\/<br \/>\nTrigger-Template:<br \/>\nDevice.+[[$cdpname]]\\..+\\..+.+<br \/>\nTrigger-Commands:<br \/>\nDEBUG: conf t<br \/>\nDEBUG: int $cdpport<br \/>\nDEBUG: desc $cdpname<\/p>\n<p>Now you can change the description to anything you choose not just CDP<\/p>\n<p>Additional scripts can be found on our <a href=\"https:\/\/github.com\/infobloxopen\/netmri-toolkit\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub Repo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A customer wanted to modify all &#8220;trunking&#8221; interfaces description to add the CDP neighbor name to it. Not a problem for NetMRI We run a show command to get all the Trunking interfaces Then run another show command to get the CDP details for all the trunking interfaces Once we have the CDP details, we [&hellip;]<\/p>\n","protected":false},"author":260,"featured_media":4030,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[3],"tags":[159,16,91,145],"class_list":{"0":"post-3903","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-community","8":"tag-automation","9":"tag-infoblox","10":"tag-nccm","11":"tag-netmri","12":"entry"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Modify Cisco interface description on all Trunking Interface<\/title>\n<meta name=\"description\" content=\"A customer wanted to modify all &quot;trunking&quot; interfaces description to add the CDP neighbor name to it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modify Cisco interface description on all Trunking Interface\" \/>\n<meta property=\"og:description\" content=\"A customer wanted to modify all &quot;trunking&quot; interfaces description to add the CDP neighbor name to it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/\" \/>\n<meta property=\"og:site_name\" content=\"Infoblox Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-19T11:00:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-06T17:26:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"380\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sif Baksh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sif Baksh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/\"},\"author\":{\"name\":\"Sif Baksh\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/person\\\/d78ba19c60e3345e0b057ecb0f990108\"},\"headline\":\"Modify Cisco interface description on all Trunking Interface\",\"datePublished\":\"2019-11-19T11:00:50+00:00\",\"dateModified\":\"2020-05-06T17:26:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/\"},\"wordCount\":189,\"publisher\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-cdc-sharing-is-caring.jpg\",\"keywords\":[\"automation\",\"Infoblox\",\"NCCM\",\"NetMRI\"],\"articleSection\":[\"Community\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/\",\"name\":\"Modify Cisco interface description on all Trunking Interface\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-cdc-sharing-is-caring.jpg\",\"datePublished\":\"2019-11-19T11:00:50+00:00\",\"dateModified\":\"2020-05-06T17:26:53+00:00\",\"description\":\"A customer wanted to modify all \\\"trunking\\\" interfaces description to add the CDP neighbor name to it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-cdc-sharing-is-caring.jpg\",\"contentUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-cdc-sharing-is-caring.jpg\",\"width\":600,\"height\":380,\"caption\":\"Infoblox CDC, Sharing is Caring!\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-modify-interface\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Community\",\"item\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/category\\\/community\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Modify Cisco interface description on all Trunking Interface\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\",\"name\":\"infoblox.com\\\/blog\\\/\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\",\"name\":\"Infoblox\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-logo-2.svg\",\"contentUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/infoblox-logo-2.svg\",\"width\":137,\"height\":30,\"caption\":\"Infoblox\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/person\\\/d78ba19c60e3345e0b057ecb0f990108\",\"name\":\"Sif Baksh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blogs.infoblox.com\\\/wp-content\\\/uploads\\\/avatar_user_260_1582930725-96x96.jpg\",\"url\":\"https:\\\/\\\/blogs.infoblox.com\\\/wp-content\\\/uploads\\\/avatar_user_260_1582930725-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/blogs.infoblox.com\\\/wp-content\\\/uploads\\\/avatar_user_260_1582930725-96x96.jpg\",\"caption\":\"Sif Baksh\"},\"description\":\"Sif is a Principal Sales Engineer at Infoblox where he provides technical expertise regarding Infoblox solutions with a focus on Network Automation and Cybersecurity. He has been with Infoblox for over 7 years, starting in the Professional Services org where he performed NetMRI deployments at many of the largest companies in the world. Outside of work, Sif can be found at the local hackerspace where he volunteers as a leading cybersecurity educator. Online he can be found @sifbaksh running the regex daily channel.\",\"sameAs\":[\"https:\\\/\\\/sifbaksh.com\\\/\"],\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/author\\\/sif-baksh\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Modify Cisco interface description on all Trunking Interface","description":"A customer wanted to modify all \"trunking\" interfaces description to add the CDP neighbor name to it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/","og_locale":"en_US","og_type":"article","og_title":"Modify Cisco interface description on all Trunking Interface","og_description":"A customer wanted to modify all \"trunking\" interfaces description to add the CDP neighbor name to it.","og_url":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/","og_site_name":"Infoblox Blog","article_published_time":"2019-11-19T11:00:50+00:00","article_modified_time":"2020-05-06T17:26:53+00:00","og_image":[{"width":600,"height":380,"url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg","type":"image\/jpeg"}],"author":"Sif Baksh","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sif Baksh","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#article","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/"},"author":{"name":"Sif Baksh","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/person\/d78ba19c60e3345e0b057ecb0f990108"},"headline":"Modify Cisco interface description on all Trunking Interface","datePublished":"2019-11-19T11:00:50+00:00","dateModified":"2020-05-06T17:26:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/"},"wordCount":189,"publisher":{"@id":"https:\/\/www.infoblox.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg","keywords":["automation","Infoblox","NCCM","NetMRI"],"articleSection":["Community"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/","url":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/","name":"Modify Cisco interface description on all Trunking Interface","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#primaryimage"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg","datePublished":"2019-11-19T11:00:50+00:00","dateModified":"2020-05-06T17:26:53+00:00","description":"A customer wanted to modify all \"trunking\" interfaces description to add the CDP neighbor name to it.","breadcrumb":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#primaryimage","url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg","contentUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-cdc-sharing-is-caring.jpg","width":600,"height":380,"caption":"Infoblox CDC, Sharing is Caring!"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-modify-interface\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infoblox.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Community","item":"https:\/\/www.infoblox.com\/blog\/category\/community\/"},{"@type":"ListItem","position":3,"name":"Modify Cisco interface description on all Trunking Interface"}]},{"@type":"WebSite","@id":"https:\/\/www.infoblox.com\/blog\/#website","url":"https:\/\/www.infoblox.com\/blog\/","name":"infoblox.com\/blog\/","description":"","publisher":{"@id":"https:\/\/www.infoblox.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infoblox.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.infoblox.com\/blog\/#organization","name":"Infoblox","url":"https:\/\/www.infoblox.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-logo-2.svg","contentUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/infoblox-logo-2.svg","width":137,"height":30,"caption":"Infoblox"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/person\/d78ba19c60e3345e0b057ecb0f990108","name":"Sif Baksh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blogs.infoblox.com\/wp-content\/uploads\/avatar_user_260_1582930725-96x96.jpg","url":"https:\/\/blogs.infoblox.com\/wp-content\/uploads\/avatar_user_260_1582930725-96x96.jpg","contentUrl":"https:\/\/blogs.infoblox.com\/wp-content\/uploads\/avatar_user_260_1582930725-96x96.jpg","caption":"Sif Baksh"},"description":"Sif is a Principal Sales Engineer at Infoblox where he provides technical expertise regarding Infoblox solutions with a focus on Network Automation and Cybersecurity. He has been with Infoblox for over 7 years, starting in the Professional Services org where he performed NetMRI deployments at many of the largest companies in the world. Outside of work, Sif can be found at the local hackerspace where he volunteers as a leading cybersecurity educator. Online he can be found @sifbaksh running the regex daily channel.","sameAs":["https:\/\/sifbaksh.com\/"],"url":"https:\/\/www.infoblox.com\/blog\/author\/sif-baksh\/"}]}},"_links":{"self":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/3903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/users\/260"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/comments?post=3903"}],"version-history":[{"count":10,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/3903\/revisions"}],"predecessor-version":[{"id":4204,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/3903\/revisions\/4204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media\/4030"}],"wp:attachment":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media?parent=3903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/categories?post=3903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/tags?post=3903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}