{"id":4172,"date":"2024-06-04T21:13:29","date_gmt":"2024-06-04T21:13:29","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4172"},"modified":"2024-06-04T21:13:40","modified_gmt":"2024-06-04T21:13:40","slug":"extreme-networks-exos-python-script-nameerror-name-exsh-is-not-defined","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4172","title":{"rendered":"Extreme Networks EXOS Python Script: &#8220;NameError: name &#8216;exsh&#8217; is not defined&#8221;"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I was attempting to run a Python script on a Extreme Networks EXOS switch, but it didn&#8217;t work. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>* switch1.46 # run script snmpassist.py\nTraceback (most recent call last):\n  File \"\/usr\/local\/cfg\/snmpassist.py\", line 11, in &lt;module>\n    config = exsh.clicmd('show config snmp', capture=True)\nNameError: name 'exsh' is not defined<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The fix was simple, add the following line to the Python script to import the &#8220;exsh&#8221; module.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was attempting to run a Python script on a Extreme Networks EXOS switch, but it didn&#8217;t work. The fix was simple, add the following line to the Python script to import the &#8220;exsh&#8221; module.<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-4172","post","type-post","status-publish","format-standard","hentry","category-extreme-networks"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4172"}],"version-history":[{"count":2,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4172\/revisions"}],"predecessor-version":[{"id":4174,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4172\/revisions\/4174"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}