Introduction
As about a year ago I took over development of John Murphy’s NetApp Ontap Cluster monitoring plugin, I was in need of some way to debug Perl scripts in Windows. After some online research, it seemed Eclipse with the EPIC plugin was the way to go. One small notice is that Eclipse is built with Java and hence consumes quite a bit of RAM. I wouldn’t recommend using it with less then 4 GB of RAM.
To make it easier for people to debug Perl scripts from a Wndows client, I’ll list the steps here how to get things running smoothly.
How to debug Perl scripts?
- Download and install Eclipse.
- Download and install ActivePerl
- Verify installation by opening cmd.exe and type perl -v
123456789101112131415Microsoft Windows [Version 6.3.9600](c) 2013 Microsoft Corporation. Alle rechten voorbehouden.C:\Users\Willem>perl -vThis is perl, v5.8.8 built for msysCopyright 1987-2006, Larry WallPerl may be copied only under the terms of either the Artistic License or theGNU General Public License, which may be found in the Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should be found onthis system using "man perl" or "perldoc perl". If you have access to theInternet, point your browser at http://www.perl.org/, the Perl Home Page. - Open Eclipse, go to Help menu and select Eclipse Marketplace. Search for EPIC or Eclipse Perl Integration and install the EPIC components. You can find more info about EPIC on their website.
- In order to see local variables, PadWalker needs to be installed. Before you can use the Perl Package Manager, you client needs a reboot (after installation of ActivePerl). Open command windows (cmd.exe) and type ‘ppm install PadWalker’, which would result in something similar like this output:
123456789ppm install PadWalkerDownloading ActiveState Package Repository packlist...doneUpdating ActiveState Package Repository database...doneSyncing site PPM database with .packlists...doneDownloading PadWalker-2.1...doneUnpacking PadWalker-2.1...doneGenerating HTML for PadWalker-2.1...doneUpdating files in site area...done3 files installed - Next thing would be to show line numbers, as looking for line 1085 in a 2000 line script is quite hard without it. Go to the Window menu, and choose Preferences. Next, choose Perl EPIC in the left column and enable the checkbox left of “Show line numbers”.
Enjoy your debug Perl hunt. I hope it can help you finding and solving issues in the check_netapp_ontap script.
Let me know if there are better free Perl debugging methods on Windows in a comment!
Willem