VMware {code} Community
dshanke
Contributor
Contributor

Usage of BrowseDiagnosticLog

Hi,

The 'BrowseDiagnosticLog' API accepts four parameters -

i) MOR to HostSystem (optional), ii) key (mandatory), iii) start (optional), iv) lines(optional)

I am able to use the 'BrowseDiagnosticLog' API when directly logged on to an ESX/ESXi server to retrieve log files from the host system for corresponding keys - . (I do not have to provide the MOR, since I am querying self)

But when logged on to a vCenter server, I wasunder the impression that if we need to retrieve log files belonging to a host system, then just by providing the MOR of that host system to 'BrowseDiagnosticLog' API, it will be able to fetch the log files for the corresponing host. But this does not seem to happen.

Any idea if it is possible to retrieve the log files of host via vCenter?

Any help much appreciated!

Thanks,

Damodar Shanke

Reply
0 Kudos
1 Reply
lamw
Community Manager
Community Manager

Yes this is possible, I don't recall, but you may actually need define the start when extracting logs from a host via vCenter.

In either case, please take a look at vSphere SDK for Perl Utility - hostdiagnostics which implements log collection from a host from both directly ESX(i) host or from vCenter.

You can compare your code and see what might be missing.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".