oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Contribution: Vmware Esxi model

Open marmack95 opened this issue 1 year ago • 0 comments

Hello, I know oxidized was developped for network device, but it's usefull to backup some others devices types, as in my case Vmware ESXi.

It's seems that oxidized does not support multiple input (example: make a first connection in ssh and a second in http). https://github.com/ytti/oxidized/issues/709

So I create un model in 2 parts, to make it works.

Important: To use it, you must enable ssh and authorize on firewall ssh connection from oxidized server on each ESXi.

The 1st model: connect in ssh, generate the local backup (could not choose folder/name), and create un static download link. NB: the backup is deleted after 5 min by ESXi.

The 2nd model: retrieve the configuration file using the static download link.

On Oxidized config, i ...

  • enable "keyboard-interactive" (except if you use publickey)
  • disable dns resolve
  • add some variables:
vars:
  copyby2ndmodel: true
  selfcopy: false

On my device list, i create 2 lines per device:

#device:ip:group:model:input
myserver.log:192.168.0.10:vmware_esxi_p1:mygroup
myserver.tgz:192.168.0.10:vmware_esxi_p2:mygroup:http

The 1st model will create the file myserver.log (which can be removed) and the 2nd model will create the file myserver.tgz .

NB:

  • this solution don't use Vmware software but native cli
  • on ESXi, SCP command don't accept to script it with password, but it's possible using a ssh key (if you enable 'ssh client' on Esxi firewall). Lines to use SCP are commented in model.
  • you can rewrite the 2nd model, if you prefer retrieve configuration with SCP (input added in oxidized 0.30.1) instead of HTTP. I've not test it.

Tested on ESXi 7.x (should work on ESXi 6.x) with Oxidized 0.30.1-14-g2bfd3f2 (docker version).

vmwareesxi_p1.txt vmwareesxi_p2.txt

marmack95 avatar Apr 25 '24 14:04 marmack95