VMware {code} Community
gilesm
Contributor
Contributor

Retrieve diagnostic logs with SDK?

Does anyone know if you can automate the changes in various logs (hostd, vpxa, etc.) and export a log bundle using the SDK? Whenever I encounter a customer who has problems with my vSphere Web Services code usage, I have to go through their vCenter and ESX hosts to increase the log levels and other variuos settings (for SDK support). It would be nice if the SDK allowed me to make these changes, restart the relevant ESX management agents, and export the system logs programmatically. Is this possible? Thanks.

0 Kudos
2 Replies
lamw
Community Manager
Community Manager

You can when generating the diagonistic bundle from vCenter via the vSphere APIs, I don't believe you can with ESX hosts as that is something you need to tweak in a configuration file. Though with vCenter, if you change the log level, I believe it may also change how it pulls information from the host but I'me not 100% sure.

Basically you would use the optionManager and change the vCenter advanced key "log.level" to whatever level you need it to be and then you can run the GenerateLogBundles_Task.

An even easier way to do this is using a recent VMware Lab flings tool called VC StatLevelConfig - http://labs.vmware.com/flings/vc-statlevelconfig which was created soley for this purpose where you may need a higher level of logging stat collection for a short period of time such as troubleshooting/debugging an issue. If you need the full diag bundle, then the first option maybe what you want

0 Kudos
gilesm
Contributor
Contributor

I'm not really concerned with the Stat collection levels at this time. I wrote a quick app using the suggested Task and it seems to be working. Thanks.

0 Kudos