Skip to content

Instantly share code, notes, and snippets.

@dehio3
Created June 23, 2016 13:33
Show Gist options
  • Select an option

  • Save dehio3/894a2ce0a4783594e5abe3296f2b6ff5 to your computer and use it in GitHub Desktop.

Select an option

Save dehio3/894a2ce0a4783594e5abe3296f2b6ff5 to your computer and use it in GitHub Desktop.
各ESXiにssh接続し、仮想サーバのサマリー情報を取得するスクリプト(ssh実行コマンドテキスト)
rm /tmp/vmsvc.summary* ; vim-cmd vmsvc/getallvm | awk -v esxi=`uname -n` '($1~/^[0-9]+$/){print $2;command = sprintf("vim-cmd vmsvc/get.summary %s > /tmp/vmsvc.summary,%s,%s",$1,esxi,$1);buf = system(command);close(command)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment