Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VMware perl script

Posted on 2010-09-20
2
737 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 250 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 23

Assisted Solution

by:Luciano Patrão
Luciano Patrão earned 250 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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

828 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