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 5 (it can gather data from vCenter Server 5.0 and ESXi 5.0). The instructions below explain how to download and install the "5.0 Update 1" release of the vSphere SDK for Perl. This version of the SDK is backward compatible with vSphere 4.0 and 4.1.
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 IP address of the FA for later steps:
- In the vSphere client, select the FA VM, then click the Summary tab. In the "General" panel, an IP address should be displayed. The FA contains VMware Tools, which makes the IP address known to vSphere.
- If the IP address does not display in the Summary tab, you can get it manually by logging into the virtual console accessible using 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 you booted the FA using the default values (DHCP) but it did not find a DHCP server, the FA may not be assigned an IP address. To correct this problem assign the FA a static IP address. See "Set static IP addresses" in this manual for details on how to do this.
- Go to VMware's web site: To download the SDK package, create or log in to your user account on the VMware site. You must have a user account to download the software. We recommend that you download the .tar.gz file to a location accessible by the FA VM via the network (such as a shared network drive, a nearby server, or your local laptop or desktop). Using a web browser, go to:
- Download the correct SDK version:
- Choose "Release 5.0 Update 1" on the drop-down menu and click the "Download" link.
- You will need to login using your VMware web site account (or create one, then log in).
- Accept the "End-User License Agreement" by clicking "yes".
- On the Download page, click the "Use Web Browser" radio button, then choose the "gz" link in table row labelled "vSphere SDK for Perl - 64-bit Linux Installer" (currently the 2nd row).
- Your web browser should download the Linux 64-bit PerlSDK package, version 5 Update 1. The file name is
VMware-vSphere-Perl-SDK-5.0.0-615831.x86_64.tar.gz
.
- Transfer the SDK file to the FA VM: When you have a local copy of the package, you can then 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). Verify that the Perl SDK package was transferred correctly by changing into the directory where you transferred the file and seeing if it's there (preferably in /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, assume the destination FA's IP address is 192.168.10.10. Run scp
like this (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 properly 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.0.0-615831.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, 1.0.1, 1.0.2
Feedback submitted, thanks!