{"id":542,"date":"2020-10-18T21:05:44","date_gmt":"2020-10-18T20:05:44","guid":{"rendered":"http:\/\/192.168.8.14\/?p=542"},"modified":"2020-10-18T21:05:44","modified_gmt":"2020-10-18T20:05:44","slug":"netapp-performance-monitoring-using-powershell","status":"publish","type":"post","link":"https:\/\/www.jasonstreet.com\/?p=542","title":{"rendered":"NetApp performance monitoring using Powershell"},"content":{"rendered":"\n<p>I recently had to run some monitoring commands to gather information while a backup was running.  So I used Powershell.<\/p>\n\n\n\n<p>I needed to SSH on to the FAS and run the following:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nset -privilege advanced\nstatistics aggregate show\nstatistics cache flash-pool show\n<\/pre><\/div>\n\n\n<p>So why should I do that when I can get Powershell to do it.<\/p>\n\n\n\n<p>Here is a quick bit of Powershell to SSH on to the FAS and run commands<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n$FASCred = Get-Credential\n$Sess = New-SSHSession -ComputerName FAS01 -Credential $FASCred -AcceptKey\n\nInvoke-SSHCommand -SSHSession $Sess -Command &quot;set -privilege advanced&quot;\n\n# now we can loop\/re-run the following commands as often as we like.\n$SSHCommand = &quot;statistics aggregate show&quot;\n$res = Invoke-SSHCommand -SSHSession $Sess -Command $SSHCommand \n\n$res.Output | out-file &quot;Aggregate.log&quot; -Append\n\n$SSHCommand = &quot;statistics cache flash-pool show&quot;\n$res = Invoke-SSHCommand -SSHSession $Sess -Command $SSHCommand \n\n$res.Output | out-file &quot;Flash-Pool.log&quot; -Append\n<\/pre><\/div>\n\n\n<p>I also had to run some other specific information gathering commands but that&#8217;s the process I used.<\/p>\n\n\n\n<p>Other statistical commands are:<\/p>\n\n\n\n<p><em>cluster statistics show<\/em><\/p>\n\n\n\n<p>FAS01::*&gt; statistics [tab]<br><em>aggregate   cache   catalog   disk   lif<br>lun   namespace   node   port   preset<br>qtree   samples   settings   show   show-periodic<br>start   stop   system   top   volume<br>vserver   workload<\/em><\/p>\n\n\n\n<p>If I issued the command <em>&#8220;set -privilege advanced&#8221;<\/em> on the SSH console I would need to confirm by entering &#8220;y&#8221;.  The Powershell  <em>Invoke-SSHCommand -SSHSession $Sess -Command &#8220;set -privilege advanced&#8221;<\/em> also issued the &#8220;y&#8221; confirmation.<\/p>\n\n\n\n<p>Occasionally I find I cannot do something in the Powershell Data.ONTAP module, so a fallback is to SSH on to the FAS, invoke a console command and return the output.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had to run some monitoring commands to gather information while a backup was running. So I used Powershell. I needed to SSH on to the FAS and run the following: So why should I do that when I can get Powershell to do it. Here is a quick bit of Powershell to SSH&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[58,59,4],"tags":[60,13,102],"class_list":["post-542","post","type-post","status-publish","format-standard","hentry","category-netapp","category-ontap","category-powershell","tag-netapp","tag-powershell","tag-ssh"],"_links":{"self":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=542"}],"version-history":[{"count":5,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/542\/revisions"}],"predecessor-version":[{"id":555,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=\/wp\/v2\/posts\/542\/revisions\/555"}],"wp:attachment":[{"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasonstreet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}