VMware Cloud Community
ngerasim
Contributor
Contributor
Jump to solution

Need to generate a report for uptime/availability? Suggestions?!

Management has requested a general uptime availability report for our environments. I know there is an uptime metric that is logged in vCenter, however I am unsure if that is reset everytime a Host is rebooted or if its incremented in some manner. They want to see the uptime availability trend for all of the ESXi Hosts for the past year.

Any input is appreciated.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Correct, you can only have 1 PowerCLI build installed.

Can't you install 4.1.0 on another client ?

Or you take the logic from the program and use a script to do the same.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
15 Replies
AureusStone
Expert
Expert
Jump to solution

Looks like someone has already done all of the work for you.

http://communities.vmware.com/docs/DOC-14433

Smiley Happy

Just modify this script to whatever management wants. 

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Seems like this would do exactly what I want, if I could get it to work. It throws error and crashes everytime I launch it.

0 Kudos
AureusStone
Expert
Expert
Jump to solution

Do you have .Net2.0 and PowerCLI 2.0?

Can you copy paste the errors you receive?

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Windows XP x86 SP3

Faulting application esxar.exe, version 1.0.0.0, stamp 4d1b331c, faulting module kernel32.dll, version 5.1.2600.5781, stamp 49c4f482, debug? 0, fault address 0x00012afb.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

This is the error returned on Server 2008 R2.

Log Name:      Application
Source:        Application Error
Date:          6/26/2011 8:38:36 PM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      XXXXXXXXXX

Description:
Faulting application name: ESXAR.exe, version: 1.0.0.0, time stamp: 0x4d1b331c
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdbdf
Exception code: 0xe0434f4d
Fault offset: 0x0000b727
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-06-27T03:38:36.000000000Z" />
    <EventRecordID>13657</EventRecordID>
    <Channel>Application</Channel>
    <Computer>XXXXXXXXXXXComputer>
    <Security />
  </System>
  <EventData>
    <Data>ESXAR.exe</Data>
    <Data>1.0.0.0</Data>
    <Data>4d1b331c</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>6.1.7600.16385</Data>
    <Data>4a5bdbdf</Data>
    <Data>e0434f4d</Data>
    <Data>0000b727</Data>
  </EventData>
</Event>

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Long shot, did you run the application as an Administrator or as a regular user ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Unhandled Exception: System.TypeInitializationException: The type initializer for 'ESXAR.ESXAR' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'VMware.Vim, Version=4.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f' or one of its dependencies. The system cannot find the file specified.
File name: 'VMware.Vim, Version=4.1.0.0, Culture=neutral, PublicKeyToken=10980b081e887e9f'
   at ESXAR.ESXAR..cctor()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

   --- End of inner exception stack trace ---
   at ESXAR.ESXAR.Main(String[] args)

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

I tried as both.

LucD wrote:

Long shot, did you run the application as an Administrator or as a regular user ?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I had a quick look at the source code and I have the impression the application is written for PowerCLI 4.1.

In fact the DLL vmware.vim.dll, with version 4.1.0, is hardcoded in the project.

So if you are using another PowerCLI version, for example PowerCLI 4.1U1 which has version 4.1.1 for vmware.vim.dll, that could explain the application error.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Well, this poses and issue. Its my understanding I cannot have two PowerCLI versions/libraries installed at the same time. Seems the only option is to remove the current iteration and install the prior version (4.1.0 |                   07/13/10 |                   264274)

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Correct, you can only have 1 PowerCLI build installed.

Can't you install 4.1.0 on another client ?

Or you take the logic from the program and use a script to do the same.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Im going to take the source code and work with a few developers here to see if we can get it to do even more. Like report uptime of VMs and such.

However, in the interim. Going to the older iteration of CLI fixed the issue. Thanks Luc. Smiley Happy

0 Kudos
ngerasim
Contributor
Contributor
Jump to solution

Example of the output. In case someone wants to see. I was suprised some of our Hosts have had 650+ days of uptime. Quite impressive.

ESXi Availability Report - May, 2011
--------------------------
  eppvh308
          Avail. (Month): 99.9993%
          Current Uptime: 19 Days 0h 45m 20s

       Lost Con. (Month): 0 Days 0h 0m 20s
--------------------------
  eppvh307
          Avail. (Month): 100%
          Current Uptime: 19 Days 0h 58m 18s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh306
          Avail. (Month): 100%
          Current Uptime: 7 Days 0h 41m 10s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh305
          Avail. (Month): 100%
          Current Uptime: 7 Days 23h 0m 36s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh302
          Avail. (Month): 100%
          Current Uptime: 7 Days 23h 36m 19s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh301
          Avail. (Month): 100%
          Current Uptime: 8 Days 0h 23m 14s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh315
          Avail. (Month): 100%
          Current Uptime: 26 Days 7h 17m 34s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh318
          Avail. (Month): 100%
          Current Uptime: 26 Days 7h 17m 41s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh316
          Avail. (Month): 100%
          Current Uptime: 26 Days 7h 17m 39s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh317
          Avail. (Month): 99.9991%
          Current Uptime: 26 Days 7h 17m 47s

       Lost Con. (Month): 0 Days 0h 0m 23s
--------------------------
  eppvh326
          Avail. (Month): 99.9989%
          Current Uptime: 424 Days 8h 20m 24s

       Lost Con. (Month): 0 Days 0h 0m 29s
--------------------------
  eppvh321
          Avail. (Month): 100%
          Current Uptime: 235 Days 3h 31m 21s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh322
          Avail. (Month): 100%
          Current Uptime: 235 Days 2h 29m 34s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh323
          Avail. (Month): 100%
          Current Uptime: 670 Days 5h 3m 46s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh324
          Avail. (Month): 100%
          Current Uptime: 670 Days 7h 58m 44s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh325
          Avail. (Month): 100%
          Current Uptime: 658 Days 3h 50m 47s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh328
          Avail. (Month): 100%
          Current Uptime: 101 Days 7h 43m 21s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh327
          Avail. (Month): 100%
          Current Uptime: 101 Days 7h 43m 6s

       Lost Con. (Month): 0 Days 0h 0m 0s
--------------------------
  eppvh348
          Avail. (Month): 99.9992%
          Current Uptime: 71 Days 7h 44m 29s

       Lost Con. (Month): 0 Days 0h 0m 22s
--------------------------
  eppvh303
          Avail. (Month): 99.9992%
          Current Uptime: 71 Days 6h 12m 51s

       Lost Con. (Month): 0 Days 0h 0m 21s
--------------------------
  eppvh304
          Avail. (Month): 99.9987%
          Current Uptime: 71 Days 7h 9m 46s

       Lost Con. (Month): 0 Days 0h 0m 34s
--------------------------
  eppvh311
          Avail. (Month): 99.9913%
          Current Uptime: 71 Days 6h 49m 7s

       Lost Con. (Month): 0 Days 0h 3m 53s
--------------------------
  eppvh312
          Avail. (Month): 99.9938%
          Current Uptime: 71 Days 6h 58m 11s

       Lost Con. (Month): 0 Days 0h 2m 46s
--------------------------
  eppvh341
          Avail. (Month): 99.9913%
          Current Uptime: 70 Days 3h 19m 32s

       Lost Con. (Month): 0 Days 0h 3m 52s
--------------------------
  eppvh347
          Avail. (Month): 99.9913%
          Current Uptime: 71 Days 7h 55m 41s

       Lost Con. (Month): 0 Days 0h 3m 52s
--------------------------
  eppvh346
          Avail. (Month): 99.9989%
          Current Uptime: 71 Days 7h 21m 17s

       Lost Con. (Month): 0 Days 0h 0m 30s
--------------------------
  eppvh342
          Avail. (Month): 99.9913%
          Current Uptime: 71 Days 6h 37m 9s

       Lost Con. (Month): 0 Days 0h 3m 52s
--------------------------
  eppvh345
          Avail. (Month): 99.9992%
          Current Uptime: 71 Days 7h 32m 49s

       Lost Con. (Month): 0 Days 0h 0m 22s
--------------------------
  eppvh343
          Avail. (Month): 99.9968%
          Current Uptime: 71 Days 8h 20m 13s

       Lost Con. (Month): 0 Days 0h 1m 25s
--------------------------
  eppvh344
          Avail. (Month): 99.9913%
          Current Uptime: 71 Days 8h 5m 11s

       Lost Con. (Month): 0 Days 0h 3m 52s
--------------------------

0 Kudos
msmith2508
Contributor
Contributor
Jump to solution

anyone have any luck getting this to run on esxi 5.0 U1?

0 Kudos
TonyCrescence
Contributor
Contributor
Jump to solution

Hi,

Can you share the source code please ?

Tony

0 Kudos