DX Infrastructure Management

 View Only

Develop a custom Perl probe with this kickstarter - Part 1 

Feb 03, 2017 05:19 AM

Hi folks,

 

This is the first part in a series that will help you get up and running with developing a custom Perl probe for UIM on Windows. I have been running several probes this way for a few years. The reliability has been excellent and the flexibility that the code enables has allowed us to provide some highly bespoke monitoring.

 

Part 1 deals with installing Perl and a package creator, making a copy of the code template and compiling it.

 

On the machine that you want to develop from, download and install Strawberry Perl MSI edition. Note that 5.14 is the only version currently supported by the Perl SDK. You must use Strawberry rather than ActiveState becuase the CPAN install of PAR::Packer below does not work with ActiveState. This is a known issue logged on their website. I have also had problems when ActiveState and Strawberry are installed side by side. Either remove ActiveState if possible, or start with a clean OS and install Strawberry only. You should also have the Nimsoft robot installed on the same machine, with the SDK_Perl 5.06 package installed.

 

http://strawberryperl.com/download/5.14.4.1/strawberry-perl-5.14.4.1-64bit.msi

 

Once installed, drop into the command line and run the following command from the Perl bin directory: -

 

perl -MCPAN -e "install PAR::Packer"

 

 

This is used later to compile a Perl script into an executable file. This removes the need for the full installation of Perl on a robot that is going to be running the custom probe. You can run a custom Perl probe without installing Perl on every single robot.

 

The output from the CPAN install command above is quite baffling and takes about 20 minutes to finish. I have attached a successful output (ParPackerInstall.txt) to hopefully help with troubleshooting. There are 3 packages on which PAR::Packer is depenedent, and these are installed first.

 

Warning: prerequisite Getopt::ArgvFile 1.07 not found.
Warning: prerequisite Module::ScanDeps 1.21 not found.
Warning: prerequisite PAR 1.014 not found. We have 1.007.

 

These are installed in turn, so if you get any errors, try and see which pacakge is failing. Once they are done, PAR::Packer itself is installed. The last three lines should look like this: -

 

Appending installation info to C:\strawberry\perl\lib/perllocal.pod
  RSCHUPP/PAR-Packer-1.036.tar.gz
  C:\strawberry\c\bin\dmake.exe install UNINST=1 -- OK

 

You can test PAR::Packer like this: -

 

echo print "\n\nHello world!\n\n" > helloWorld.pl

pp -o helloWorld.exe helloWorld.pl

helloWorld.exe

 

 

Next you need to choose a name for your probe and a group for it to live in. In this example, the probe will be called 'perfmonWindow' and it will live in the 'Custom' probe group.

 

On your dev machine, drop into the probes folder; 32bit C:\Program Files (x86)\Nimsoft\probes; 64bit C:\Program Files\Nimsoft\Nimsoft Robot x64\probes

 

Create a folder with the same name as the group you have chosen if it does not already exist. Within that folder, create another folder with the same name as the probe and add '_dev' to the end. Copy the attached files 'example_probe.pl' and 'example_probe.cfg' into this folder. Rename both them, replacing example_probe with your probe name. Then use the pp command to compile the .pl file into an executable.

 

 

Then run the executable, wait for a couple of minutes and hit Ctrl-C. Then look at the log file and hopefully you should have something like this: -

 

 

Congratulations if you have got this far. You can move on to the next part.

 

If you see any errors when running the probe, check that you have the SDK_Perl package installed and you are working with the directory structure as seen above. If the system cannot find or reference the API libraries, the probe will not run. You must make sure they are installed, and your use statement at the top of code points to the perllib directory.

 

Statistics
0 Favorited
45 Views
3 Files
0 Shares
13 Downloads
Attachment(s)
zip file
ParPackerInstall.txt.zip   4 KB   1 version
Uploaded - May 29, 2019
zip file
example_probe.pl.zip   1 KB   1 version
Uploaded - May 29, 2019
zip file
example_probe.cfg.zip   200 B   1 version
Uploaded - May 29, 2019

Tags and Keywords

Comments

Feb 07, 2017 05:26 AM

Feb 07, 2017 05:06 AM

Nice ! I added this post to my framework starter guide

GitHub - fraxken/perluim: CA UIM perl object-oriented framework 

Feb 03, 2017 08:07 AM

Very informative and descriptive. Thank Pmatt for this, waiting for the next one in this series.

 

Regards

Hitesh 

Feb 03, 2017 07:02 AM

Paul - thank you for your post and contribution to the community - I look forward to the series

Related Entries and Links

No Related Resource entered.