View get_perf_info.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use VMware::VIRuntime; | |
Opts::parse(); | |
Opts::validate(); | |
# connect server. | |
Util::connect(); |
View get_vm_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'IP or FQDN' | |
username = 'administrator@vsphere.local' |
View create_snapshot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'IP or FQDN' | |
username = 'administrator@vsphere.local' |
View delete_snapshot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'IP or FQDN' | |
username = 'administrator@vsphere.local' |
View vm_hw_version.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'vCenter IP or Host Name' | |
username = 'administrator@vsphere.local' |
View create_vm.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
import ssl | |
import atexit | |
# 接続情報 | |
host = 'vCenter IP or Host Name' | |
username = 'administrator@vsphere.local' | |
password = '' |
View zabbix_create_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from zabbix.api import ZabbixAPI | |
if __name__ == '__main__': | |
""" | |
Zabbixサーバにグループを追加するスクリプト例 | |
追加するグループは `TESTグループ` | |
""" | |
# Zabbixサーバ情報 |
View zabbix_create_host.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from zabbix.api import ZabbixAPI | |
from collections import defaultdict | |
def multi_dimension_dict(dimension, callable_obj=int): | |
""" | |
pythonで多次元連想配列を使う関数 | |
参照元: http://materia.jp/blog/20121119.html | |
""" | |
nodes = defaultdict(callable_obj) |
View get_perf_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
import ssl | |
import atexit | |
# 接続先情報 | |
host = 'ESXi or vCenter IP' | |
username = 'username' | |
password = 'password' |
View dice.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import json | |
import os | |
import time | |
import sys | |
from random import randint | |
from collections import defaultdict | |
def multi_dimension_dict(dimension, callable_obj=int): | |
""" |
OlderNewer