{"id":4473,"date":"2013-06-28T16:58:10","date_gmt":"2013-06-28T23:58:10","guid":{"rendered":"https:\/\/blogs.infoblox.com\/?p=4473"},"modified":"2020-05-06T10:31:39","modified_gmt":"2020-05-06T17:31:39","slug":"netmri-scripting-locating-devices-that-have-changed","status":"publish","type":"post","link":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/","title":{"rendered":"NetMRI Scripting: Locating Devices that Have Changed"},"content":{"rendered":"<p>A large educational institution on the East Coast functions as an ISP to parts of its large network. They wanted to determine which devices changed in the past 2 hours so that the NOC can be proactively enabled and do a configuration comparison faster for troubleshooting purposes.<\/p>\n<p>The .netmri.yml file with the user&#8217;s credentials needs to be in the home directory of your local Linux machine. This file enables credential passing between the local machine and the NetMRI API. For additional information, please consult the NetMRI API Guide that is posted in the technical documentation section of Infoblox&#8217;s Support site.<\/p>\n<pre>use NetMRI::API;\r\n# comment this out if you are running HTTP only  $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;\r\n# Configure .netmri.yml with your  \r\n# url: http:\/\/netmri\r\n# username: admin \r\n# password: secret  \r\n\r\nmy $netmri = new NetMRI::API({api_version =&gt;\"2.7\"});\r\n\r\n#this will query Network Analysis Changes to grab the information need to parse  \r\nmy @changes = $netmri-&gt;broker-&gt;ChangeSummaryNetworkAnalysisGrid-&gt;index({  starttime =&gt;\"2 hours ago\",  endtime =&gt;\"now\",  });\r\n\r\n#For each change in the ChangesSummaryNetworkAnalysisGrid, we will only look for Change Method  \r\n# contains \"Config\" and save the config to a file with DeviceName as the file name  \r\n    foreach my $change (@changes) {  \r\n    if ( $change-&gt;ChangeMethod =~ \u00a0\/Config\/ ) {  my $text = $netmri-&gt;broker-&gt;\r\n    device-&gt;saved_config_text(DeviceID=&gt;$change-&gt;DeviceID)      -&gt;{saved_config_text};\r\n\r\n        #The statement below will get the device name that NetMRI uses, and will save the config  # file to that device name  \r\n        my $save = $change-&gt;DeviceName;\r\n        open (CONFIG, \"&gt;$save\");\r\n        print CONFIG $text;\r\n        close (CONFIG);\r\n    }\r\n};<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A large educational institution on the East Coast functions as an ISP to parts of its large network. They wanted to determine which devices changed in the past 2 hours so that the NOC can be proactively enabled and do a configuration comparison faster for troubleshooting purposes. The .netmri.yml file with the user&#8217;s credentials needs [&hellip;]<\/p>\n","protected":false},"author":260,"featured_media":1914,"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":[212,145,214,211,213],"class_list":{"0":"post-4473","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-community","8":"tag-isp","9":"tag-netmri","10":"tag-noc","11":"tag-scripting","12":"tag-yml","13":"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>NetMRI Scripting: Locating Devices that Have Changed<\/title>\n<meta name=\"description\" content=\"A large educational institution on the East Coast functions as an ISP to parts of its large network.\" \/>\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-locating-devices-that-have-changed\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NetMRI Scripting: Locating Devices that Have Changed\" \/>\n<meta property=\"og:description\" content=\"A large educational institution on the East Coast functions as an ISP to parts of its large network.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/\" \/>\n<meta property=\"og:site_name\" content=\"Infoblox Blog\" \/>\n<meta property=\"article:published_time\" content=\"2013-06-28T23:58:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-06T17:31:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"660\" \/>\n\t<meta property=\"og:image:height\" content=\"454\" \/>\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-locating-devices-that-have-changed\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/\"},\"author\":{\"name\":\"Sif Baksh\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#\\\/schema\\\/person\\\/d78ba19c60e3345e0b057ecb0f990108\"},\"headline\":\"NetMRI Scripting: Locating Devices that Have Changed\",\"datePublished\":\"2013-06-28T23:58:10+00:00\",\"dateModified\":\"2020-05-06T17:31:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/\"},\"wordCount\":109,\"publisher\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/480288900-660x454-1.jpg\",\"keywords\":[\"ISP\",\"NetMRI\",\"NOC\",\"Scripting\",\"YML\"],\"articleSection\":[\"Community\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/\",\"name\":\"NetMRI Scripting: Locating Devices that Have Changed\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/480288900-660x454-1.jpg\",\"datePublished\":\"2013-06-28T23:58:10+00:00\",\"dateModified\":\"2020-05-06T17:31:39+00:00\",\"description\":\"A large educational institution on the East Coast functions as an ISP to parts of its large network.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/480288900-660x454-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/wp-content\\\/uploads\\\/480288900-660x454-1.jpg\",\"width\":660,\"height\":454,\"caption\":\"[Video] Changing Definition of Core Networking and Enterprise Expectations on Security\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.infoblox.com\\\/blog\\\/community\\\/netmri-scripting-locating-devices-that-have-changed\\\/#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\":\"NetMRI Scripting: Locating Devices that Have Changed\"}]},{\"@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":"NetMRI Scripting: Locating Devices that Have Changed","description":"A large educational institution on the East Coast functions as an ISP to parts of its large network.","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-locating-devices-that-have-changed\/","og_locale":"en_US","og_type":"article","og_title":"NetMRI Scripting: Locating Devices that Have Changed","og_description":"A large educational institution on the East Coast functions as an ISP to parts of its large network.","og_url":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/","og_site_name":"Infoblox Blog","article_published_time":"2013-06-28T23:58:10+00:00","article_modified_time":"2020-05-06T17:31:39+00:00","og_image":[{"width":660,"height":454,"url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.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-locating-devices-that-have-changed\/#article","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/"},"author":{"name":"Sif Baksh","@id":"https:\/\/www.infoblox.com\/blog\/#\/schema\/person\/d78ba19c60e3345e0b057ecb0f990108"},"headline":"NetMRI Scripting: Locating Devices that Have Changed","datePublished":"2013-06-28T23:58:10+00:00","dateModified":"2020-05-06T17:31:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/"},"wordCount":109,"publisher":{"@id":"https:\/\/www.infoblox.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.jpg","keywords":["ISP","NetMRI","NOC","Scripting","YML"],"articleSection":["Community"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/","url":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/","name":"NetMRI Scripting: Locating Devices that Have Changed","isPartOf":{"@id":"https:\/\/www.infoblox.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#primaryimage"},"image":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#primaryimage"},"thumbnailUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.jpg","datePublished":"2013-06-28T23:58:10+00:00","dateModified":"2020-05-06T17:31:39+00:00","description":"A large educational institution on the East Coast functions as an ISP to parts of its large network.","breadcrumb":{"@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#primaryimage","url":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.jpg","contentUrl":"https:\/\/www.infoblox.com\/blog\/wp-content\/uploads\/480288900-660x454-1.jpg","width":660,"height":454,"caption":"[Video] Changing Definition of Core Networking and Enterprise Expectations on Security"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infoblox.com\/blog\/community\/netmri-scripting-locating-devices-that-have-changed\/#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":"NetMRI Scripting: Locating Devices that Have Changed"}]},{"@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\/4473","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=4473"}],"version-history":[{"count":1,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/4473\/revisions"}],"predecessor-version":[{"id":4474,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/posts\/4473\/revisions\/4474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media\/1914"}],"wp:attachment":[{"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/media?parent=4473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/categories?post=4473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infoblox.com\/blog\/wp-json\/wp\/v2\/tags?post=4473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}