Using Perl (on Windows) with NetApp ONTAP - Dummy’s Guide

If you’re a regular reader of this blog, you’ll know I love a bit of PowerShell - I’ve tagged 128 posts with PowerShell. Perl - on the other hand - has yet to be tagged on one post. Well, this changes today! The titular “dummy” is me (I’m a Perl noob), and - since I work predominantly from Windows laptop/workstation - this is going to be Perl on Windows...

1) Install Perl

Firstly, we need to install Perl. The following link - - contains links to Installing Perl on Windows, OSX, and Unix/Linux.

Image: Padre on Strawberry Perl installed!

Image: Command Prompt/PowerShell and ‘perl -v’ to verify installation.

Image: App-cpanminus installed too.

2) Download the NetApp Manageability SDK (NMSDK)

> NetApp Manageability SDK > All Platforms

3) NetApp Perl Modules

Unzip the NMSDK.
To put all my Perl libraries in one place, I copy the NetApp folder from:

netapp-manageability-sdk-5.6 > lib > perl > NetApp

- to -


4) Test

Below is a very simple Perl script example taken from the NMSDK and ZExplore.

i) Copy and paste into a text editor
ii) Edit CLUSTER_NAME, USER_NAME, and PASSWORD as required.
iii) Save as
iv) Run in the DOS command prompt as>

require 5.6.1;
use lib 'C:/Strawberry/perl/lib/NetApp';
use strict;
use warnings;
use NaServer;
use NaElement;

my $s = new NaServer('CLUSTER_NAME', 1 , 31);
$s->set_admin_user('USER_NAME', 'PASSWORD');

my $api = new NaElement('system-get-version');

my $xo = $s->invoke_elem($api);
if ($xo->results_status() eq 'failed') {
  print 'Error:\n';
  print $xo->sprintf();
  exit 1;

print 'Received:\n';
print $xo->sprintf();

Note: I received an error - errno="13001" - using Cluster Management IP address, so added the name of the cluster to my hosts file and this worked.

Image: Perl success!