Install the Perl API package into the FA VM
The following instructions describe how to download and install the vSphere SDK for Perl package (Perl SDK).
What to install
The vSphere SDK for Perl provides an easy-to-use Perl scripting interface to the vSphere API. Download the SDK from VMware's web site and install it into the FA VM for it to work correctly.
Splunk for VMware is compatible with vSphere 4.1, 5.0, 5.0 update 1, and 5.1(it can gather data from vCenter Server and ESXi hosts for these VMware environments). The instructions below explain how to download and install the "5.1" release of the vSphere SDK for Perl.
If you are already running an FA VM, you can check the version of the Perl SDK that you have installed by running the command:
/usr/bin/perl -MVMware::VIRuntime -e 'print $VMware::VIRuntime::VERSION'
If it is installed, the version number of the currently running FA VM is returned. If it is not installed at all, an error is returned.
Download and install the VMware vSphere SDK for Perl
- Power on the FA VM: If the Splunk Forwarder Appliance VM (FA VM) you deployed is not already powered on, use the vSphere Client to start it now.
- Get the FA VM's IP Address: You will need the FA's IP address for further installation steps:
- In the vSphere client, select the FA VM, then click the Summary tab. In the "General" panel, the IP address of the FA is displayed. Our FA contains VMware Tools, which makes the IP address known to vSphere.
- If the IP address does not display in the Summary tab, get it manually by logging into the virtual console in the vSphere Client.
- Log into the FA VM using the password you set when you deployed it. If you did not change the password, you can use the default credentials:
- When logged in, run
ifconfig
to get the FA VM's IP address. - If an IP address is not displayed, assign the FA a static IP address. See "Set static IP addresses" in this manual for details on how to do this. The problem can result from having booted the FA using the default values (DHCP) but not finding a DHCP server
- Download the VMware SDK package To Download the SDK package, you must have a user account on the VMware site. Create an account or log in to your existing account. We recommend that you download the
.tar.gz
file to a location that the FA VM can access over the network (this can be a shared network drive, another server, your local laptop or desktop). In a Web browser, go to: - Download the correct SDK version:
- Choose "Release 5.1" on the drop-down menu and click "Download".
- Login using your VMware user account.
- Click "yes" to accept the "End-User License Agreement" .
- On the Download page, click the "Use Web Browser" radio button, then choose the "gz" link for the "vSphere SDK for Perl - 64-bit Linux Installer".
- The Linux 64-bit PerlSDK package, version 5.1 will be downloaded to the location you specified. The file name is
VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
.
- Transfer the VMware Perl SDK file to the FA VM: When you have a local copy of the package, use a file transfer program such as
scp
orWinSCP
to transfer thetar.gz
file to your FA VM. Transfer the vSphere SDK package file into the/home/splunkadmin/packages
directory as the splunkadmin user. - VLAN misconfiguration for the VM
- incorrect network settings for the Linux OS inside the FA
- network infrastructure problems
- Log into the FA VM as the splunkadmin user: SSH as the
splunkadmin
user into the FA (or log into the virtual machine console). To verify that the Perl SDK package was transferred correctly, on the FA, check the contents of/home/splunkadmin/packages
). - Extract and install the Perl SDK package:
- Untar the file to extract the Perl SDK package
- Change directories into the the vmware-vsphere-cli-distrib folder. This is the install folder.
- Run the installation script (you may be asked for the splunkadmin user's password):
- When prompted, accept the installation defaults.
- Validate your Perl SDK install: Now that your vSphere SDK for Perl installation is complete, you can verify the installation using the example instructions below.
username=splunkadmin and password=changeme
http://www.vmware.com/support/developer/viperltoolkit/
For example, to transfer the file from your local machine, to an FA with an IP address of 192.168.10.10
on another machine, run scp
to transfer the file. You will be prompted to supply a password for the splunkadmin user.:
scp VMware-vSphere-Perl-SDK-5.0.0-615831.x86_64.tar.gz splunkadmin@192.168.10.10:/home/splunkadmin/packages
Note: If you cannot transfer the Perl SDK file, check that the network settings for your FA are correctly configured. Possible problems can include:
See "Troubleshooting virtual machine network connection issues" to help diagnose the problem.
cd packages ls
You should see the vSphere Perl SDK file listed.
tar -xzvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
cd vmware-vsphere-cli-distrib
sudo ./vmware-install.pl
Verify that the Perl API package is installed
Test the connection against a vCenter Server or and ESX/i host for which you have credentials. This example assumes that you have a VC machine located and reachable via the network at 192.168.20.20. You will be prompted for a username and password to access VC. The credentials are the same as those you use to log into the VC via the vSphere Client. Run the following commands on the FA:
cd /usr/lib/vmware-vcli/apps/general ./connect.pl --url https://192.168.20.20/sdk/webService
If the script prints out "Connection Successful," you have validated that the Perl SDK is installed correctly.
Configure default properties for the FA VM | Configure forwarding |
This documentation applies to the following versions of Splunk® App for VMware (Legacy): 1.0.3
Feedback submitted, thanks!