{"id":850,"date":"2010-06-15T09:21:56","date_gmt":"2010-06-15T14:21:56","guid":{"rendered":"http:\/\/www.jasemccarty.com\/blog\/?p=850"},"modified":"2010-06-15T09:21:56","modified_gmt":"2010-06-15T14:21:56","slug":"netapp-snapmirror-monitor-script-part-3-with-dataontap-powershell-toolkit-v1-0","status":"publish","type":"post","link":"https:\/\/www.jasemccarty.com\/blog\/netapp-snapmirror-monitor-script-part-3-with-dataontap-powershell-toolkit-v1-0\/","title":{"rendered":"NetApp SnapMirror Monitor Script \u2013 Part 3 with DataONTAP PowerShell Toolkit v1.0"},"content":{"rendered":"<p>My <strong><a title=\"NetApp SnapMirror Monitor Script \u2013 Part 2 using PoshOnTap\" href=\"http:\/\/www.jasemccarty.com\/blog\/?p=554\" target=\"_self\">second attempt<\/a><\/strong> also worked out pretty well, but the <strong><a title=\"DataONTAP PowerShell Toolkit\" href=\"http:\/\/communities.netapp.com\/community\/interfaces_and_tools\/data_ontap_powershell_toolkit\" target=\"_blank\">DataONTAP PowerShell Toolkit<\/a><\/strong>, has been released, and I wanted to update my script to leverage a supported toolkit.  If you have a NetApp, and are getting deeper into using Powershell, this toolkit is for you.<\/p>\n<p>I&#8217;m not going to go deep into the details of how this script works, as most of that is covered in the<strong> <a title=\"NetApp SnapMirror Monitor Script \u2013 Part 2 using PoshOnTap\" href=\"http:\/\/www.jasemccarty.com\/blog\/?p=554\" target=\"_self\">previous post<\/a><\/strong>.<\/p>\n<p>What I am going to detail is the difference between the old and new scripts.<\/p>\n<p><strong>The Old Script<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n#Load the PoshOnTap Module\nImport-Module PoshOnTap\n\n#Connect to the Filer\nConnect-NaServer -Filer netapp2\n\n#Pull The Data\n$body = Get-NaSnapMirror|Select Source,Destination,Status,State,Lag,LastTransferSize,LastTransferDurration|Out-String\n\n#Send e-mail\nSend-MailMessage -From &quot;user@yourdomain.com&quot; -To &quot;user@yourdomain&quot; -Subject &quot;NetApp Replication Script&quot; -SmtpServer mail.domain.com -Body $body\n<\/pre>\n<p><strong>The New Script<\/strong><\/p>\n<pre class=\"brush: powershell; title: ; notranslate\" title=\"\">\n#Load the DataONTAP Module\nImport-Module DataONTAP\n\n#Connect to the Filer\nConnect-NaController netapp2\n\n#Pull The Data\n$body = Get-NaSnapmirror|Select SourceLocation,DestinationLocation,Status,State,LagTime,LastTransferSize,LastTransferDuration|Out-String\n\n#Send e-mail\nSend-MailMessage -From &quot;user@yourdomain.com&quot; -To &quot;user@yourdomain&quot; -Subject &quot;NetApp Replication Script&quot; -SmtpServer mail.domain.com -Body $body\n<\/pre>\n<p>The only differences between the 2 scripts are at lines 5 and 8.<\/p>\n<p>Line 5:<\/p>\n<ul>\n<li>Connect-NaServer -Filer becomes Connect-NaController<\/li>\n<\/ul>\n<p>Line 8:<\/p>\n<ul>\n<li>Source becomes SourceLocation<\/li>\n<li>Destination becomes DestinationLocation<\/li>\n<li>Lag becomes LagTime<\/li>\n<li>LastTransferDurration becomes LastTransferDuration (obvious typo in PoshOnTap)<\/li>\n<\/ul>\n<p>Other than those 2 lines, the scripts are identical.<\/p>\n<p>I&#8217;d like to give a shout out to <strong><a title=\"Get-Admin.com\" href=\"http:\/\/www.get-admin.com\/\" target=\"_blank\">Glenn Sizemore<\/a><\/strong> for leading the way with <strong><a title=\"PoshOnTap\" href=\"http:\/\/poshontap.codeplex.com\/\" target=\"_blank\">PoshOnTap<\/a><\/strong> and <strong><a title=\"NetApp\" href=\"http:\/\/www.netapp.com\/\" target=\"_blank\">NetApp<\/a><\/strong> for following his lead with the <strong><a title=\"Data ONTAP PowerShell Toolkit 1.0\" href=\"http:\/\/communities.netapp.com\/community\/interfaces_and_tools\/data_ontap_powershell_toolkit\" target=\"_blank\">DataONTAP PowerShell Toolkit<\/a><\/strong>.<\/p>\n<p><strong>Update to this post<\/strong><br \/>\nI was digging a little deeper on this post, and apparently dates are returned as INT64 Integers.\u00a0 Makes things a little messy, and requires some data manipulation.<\/p>\n<p>There&#8217;s a <strong><a title=\"Time values represented as integers\" href=\"http:\/\/communities.netapp.com\/thread\/8879\" target=\"_blank\">post about it<\/a><\/strong> on the NetApp Communities that details a workaround (again, kind of messy).\u00a0 PoshOnTap handles dates better, so maybe NetApp will see the issue, and quickly release a v1.1 of the toolkit to correct the problem.\u00a0 Nevertheless, I&#8217;ll continue using the supported (albeit a little more clunky with regard to dates) toolkit.<\/p>\n<p>As soon as I find a clean\/optimized way to address the situation, I will update this post.<\/p>\n<div id=\"_mcePaste\" style=\"position: absolute; left: -10000px; top: 456px; width: 1px; height: 1px; overflow: hidden;\">Using Powershell I can execute the same command, and actually get more  information.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>My second attempt also worked out pretty well, but the DataONTAP PowerShell Toolkit, has been released, and I wanted to update my script to leverage &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[56,59,72,81],"class_list":["post-850","post","type-post","status-publish","format-standard","hentry","category-virtualization","tag-netapp","tag-ontap","tag-replication","tag-smvi"],"_links":{"self":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/comments?post=850"}],"version-history":[{"count":0,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/850\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/media?parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/categories?post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/tags?post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}