What is the equivalent API in c# ? I am writing a plugin to query host logs from vi client and using vmware.vim.dll ... any clues please.
Thanks in anticipation
HK
The Get-LogType cmdlet seems to use the QueryDescriptions method available on the the DiagnosticManager object.
The Get-Log cmdlet uses the BrowseDiagnosticLog method.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The Get-LogType cmdlet seems to use the QueryDescriptions method available on the the DiagnosticManager object.
The Get-Log cmdlet uses the BrowseDiagnosticLog method.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am not getting more than 1000 lines of log mesages for any of the log types on the host. Tried connecting to host directly and through vCenter programatically.
VIM.DiagnosticManagerLogHeader logh = dm.BrowseDiagnosticLog(null, "messages", null, null)
logh always returns less than 1000 lines.
Whereas, "get-log -key messages" returns 7000+ lines of text
What is do different in using api's and cmdlets ?
I am writing a client plugin to view host logs, so i need to get into api's
Thanks in anticipation
The info about the DiagnosticManager in the SDK Reference doesn't seem to be complete/correct.
With the following script you fetch all lines (in reverse chronological order)
$esxName = <hostname> $esx = Get-VMHost -Name $esxName $si = Get-View ServiceInstance $dm = Get-View $si.Content.diagnosticManager $log = @() $logpart = $dm.BrowseDiagnosticLog($esx.Extensiondata.MoRef,"messages",$null,$null) $nrlines = $logpart.LineEnd - $logpart.LineStart + 1 $log += $logpart.LineText while($nrlines -eq 1000){ $logpart = $dm.BrowseDiagnosticLog($esx.Extensiondata.MoRef,"messages",$logpart.LineEnd + 1,$null) $nrlines = $logpart.LineEnd - $logpart.LineStart + 1 $log += $logpart.LineText }
The array $log will contain all lines.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD. But is this a bug or server limitation ? If it is a server side settings, then can we change it...AdvancedOption may be ?
I will try the solution and feedback.
Good night.