<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: having only &amp;quot;linux OS&amp;quot; with the hostname in Automation Tools Discussions</title>
    <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/having-only-quot-linux-OS-quot-with-the-hostname/m-p/2493822#M1184</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the future, you may want to be more descriptive in the request than "just give me a script" ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a lot more than just a script, what language are you looking for? Where you do plan on running this script? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll throw out an potentially solution as this is a very generic request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a vSphere SDK for Perl implementation which retrieves all VMs connected to either a vCenter server or ESX/ESXi host and prints out the VM shell name, the hostname if known and the OS type. You will need to use either the vCLI for Linux or Windows or use vMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-12901"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example output:&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
[vi-admin@scofield ]$ ./getVM.pl --server esxi4-1.primp-industries.com --username root
vs-manager    vs-manager.primp-industries.com      Other 2.6x Linux (32-bit)
vShieldB        vshieldb.primp-industries.com        Other 2.6x Linux (32-bit)
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're knew to VMware SDK/APIs, you'll want to spend some time going over this document before starting - &lt;A href="https://communities.vmware.com/d-7270"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're interested in getting started with vSphere SDK for Perl, here is a good post that provides some steps with lots of sample code - &lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html" target="test_blank"&gt;http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009,2010&lt;/P&gt;&lt;P&gt;VMware scripts and resources at: &lt;A href="http://www.virtuallyghetto.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vma.html"&gt;Getting Started with the vMA (tips/tricks)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html"&gt;Getting Started with the vSphere SDK for Perl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jun 2010 15:49:15 GMT</pubDate>
    <dc:creator>lamw</dc:creator>
    <dc:date>2010-06-18T15:49:15Z</dc:date>
    <item>
      <title>having only "linux OS" with the hostname</title>
      <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/having-only-quot-linux-OS-quot-with-the-hostname/m-p/2493821#M1183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have something like that as out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VM1  redhat  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VM2 ubuntu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VM3 windows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you give me the script to have a such out on my screen ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I also have only REdhat for ie ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx very much &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 14:23:42 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Automation-Tools-Discussions/having-only-quot-linux-OS-quot-with-the-hostname/m-p/2493821#M1183</guid>
      <dc:creator>xybal</dc:creator>
      <dc:date>2010-06-18T14:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: having only "linux OS" with the hostname</title>
      <link>https://communities.vmware.com/t5/Automation-Tools-Discussions/having-only-quot-linux-OS-quot-with-the-hostname/m-p/2493822#M1184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the future, you may want to be more descriptive in the request than "just give me a script" ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a lot more than just a script, what language are you looking for? Where you do plan on running this script? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll throw out an potentially solution as this is a very generic request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a vSphere SDK for Perl implementation which retrieves all VMs connected to either a vCenter server or ESX/ESXi host and prints out the VM shell name, the hostname if known and the OS type. You will need to use either the vCLI for Linux or Windows or use vMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-12901"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example output:&lt;/P&gt;&lt;PRE __jive_macro_name="code"&gt;
[vi-admin@scofield ]$ ./getVM.pl --server esxi4-1.primp-industries.com --username root
vs-manager    vs-manager.primp-industries.com      Other 2.6x Linux (32-bit)
vShieldB        vshieldb.primp-industries.com        Other 2.6x Linux (32-bit)
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're knew to VMware SDK/APIs, you'll want to spend some time going over this document before starting - &lt;A href="https://communities.vmware.com/d-7270"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're interested in getting started with vSphere SDK for Perl, here is a good post that provides some steps with lots of sample code - &lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html" target="test_blank"&gt;http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=========================================================================&lt;/P&gt;&lt;P&gt;William Lam&lt;/P&gt;&lt;P&gt;VMware vExpert 2009,2010&lt;/P&gt;&lt;P&gt;VMware scripts and resources at: &lt;A href="http://www.virtuallyghetto.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twitter.com/lamw"&gt;Twitter: @lamw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/d-9852"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vma.html"&gt;Getting Started with the vMA (tips/tricks)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html"&gt;Getting Started with the vSphere SDK for Perl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-3164"&gt;VMware Code Central - Scripts/Sample code for Developers and Administrators&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.vmware.com/c-2828"&gt;VMware Developer Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find this information useful, please award points for "correct" or "helpful".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jun 2010 15:49:15 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/Automation-Tools-Discussions/having-only-quot-linux-OS-quot-with-the-hostname/m-p/2493822#M1184</guid>
      <dc:creator>lamw</dc:creator>
      <dc:date>2010-06-18T15:49:15Z</dc:date>
    </item>
  </channel>
</rss>

