Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VMware perl script

Posted on 2010-09-20
2
Medium Priority
?
751 Views
Last Modified: 2013-12-25
Hello,

I need some ideas on how to write a VI perl script for Linux which returns various information about the VM. Say for example:

$ ./vmsearch foo
> VI server it is running on
> Esx cluster it is running on
> Esx host it is running on
> Data store

In the above example, foo is the name of the VM I want to search. Invoking from command line ./vmsearch foo, should return those values. Any good ideas, good approach, good practice would be good, since I'm new to perl and VMware. I'm probably a little early to post this question here, because I havent given this much thoughts yet, but again the idea is to get some thoughts, technical/not so technical, code/not so code related etc..
0
Comment
Question by:smary
2 Comments
 
LVL 22

Accepted Solution

by:
65td earned 1000 total points
ID: 33721535
Here is some information on a script with more that what you wanted.
http://communities.vmware.com/docs/DOC-9420

Too bad one wasn't asking for Powershell scripts, such as healthcheck.
http://sourceforge.net/projects/esxhealthscript/
0
 
LVL 24

Assisted Solution

by:Luciano Patrão
Luciano Patrão earned 1000 total points
ID: 33721600
Hi

With vSphere SDK for Perl 4.1 you have all this information and all the perl scripts

http://www.vmware.com/support/developer/viperltoolkit/

Just install the SKD for perl, and then in the folder VMware\VMware vSphere CLI\Perl\apps you will find many folders with perl scripts inside that extract that information(for host, datastore, VMs info, etc)

Hope this can help you

Jail
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question