Steps to add Perl DBI module to sm_perl
search cancel

Steps to add Perl DBI module to sm_perl

book

Article ID: 370190

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Customer needs to connect to a 3rd party database using the Smarts perl libraries.

Environment

Smarts 10.1.x

Cause

Perl that is included with Smarts utilizes a minimal distribution installation.

Resolution

Verify your version of Smarts

/opt/InCharge/IP/smarts/bin/sm_server --version

sm_server:
linux_rhAS50-x86-64/206320000
IP_NETWORK_SUITE: V10.1.5.0(195243), 10-Jun-2021 16:06:14 Copyright 2021, VMware Inc - Build 61
Foundation V10.1.5.0(195100), 04-Jun-2021 16:58:43 Copyright 2021, VMware Inc - Build 65

  • STEP 1

Create a symbolic link - you might have to make some changes to the Smarts BASE_DIR path to reflect your environment.

mkdir /vmware
mkdir /vmware/musalp
mkdir /vmware/musalp/PERL
mkdir /vmware/musalp/PERL/perl-64
mkdir /vmware/musalp/PERL/perl-64/lib
cd /vmware/musalp/PERL/perl-64/lib
ln -s /opt/InCharge/IP/smarts/toolbox/perl/lib/5.32.0 5.32.0

  • STEP 2

Set up your environment - you might have to make some changes to the Smarts BASE_DIR path to reflect your environment.

/opt/InCharge/IP/smarts/bin/sm_perl /opt/InCharge/IP/smarts/perl/lib/sm_perl_cfgfix.pl

  • STEP 3

Install a C compiler.

yum install gcc.x86_64

  •  STEP 4

download DBI-1.643.tar.gz, or some similar version.

DBI CPAN


cp DBI-1.643.tar.gz /tmp
cd /tmp
gunzip DBI-1.643.tar.gz
tar xvf DBI-1.643.tar

  • STEP 5

Compile the source – you might have to make some changes to the Smarts BASE_DIR path to reflect your environment.

cd /tmp/DBI-1.643
/opt/InCharge/IP/smarts/bin/sm_perl Makefile.PL
make
make test
make install

  •  STEP 6

Create a test perl script to verify the module was compiled and installed successflly.Run your script - you might have to make some changes to the Smarts BASE_DIR path to reflect your environment.

vi /tmp/my_script.pl

use DBI;

  • STEP 7

Run your script - you might have to make some changes to the Smarts BASE_DIR path to reflect your environment. 

/opt/InCharge/IP/smarts/bin/sm_perl -I /opt/InCharge/IP/smarts/perl/5.32.0/lib/ /tmp/my_script.pl

Additional Information

Note:
The sm_perl utility is packaged within the Smarts installer for internal perl related use-cases. 
Attempts to make use of sm_perl for custom operations and assistance with respect to the same would be classified under the Customization Assistance Request.