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' |
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 | |
import argparse | |
def usage(): | |
""" | |
コマンドラインオプション設定 |
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) |
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
package main | |
import ( | |
"fmt" | |
"syscall" | |
) | |
func main() { | |
// golang.org/x/sys/windows(参考) | |
// https://godoc.org/golang.org/x/sys/windows |
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/env python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
from getpass import getpass | |
import ssl | |
import atexit | |
import argparse | |
import time | |
# Network settings. |
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/env python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
from getpass import getpass | |
import ssl | |
import atexit | |
import argparse | |
import sys | |
def options(): |
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/env python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
from getpass import getpass | |
import ssl | |
import atexit | |
import argparse | |
import sys | |
def options(): |
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/env python3 | |
import xmltodict | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
def login(url="", user="", password=""): | |
""" | |
:rtype: str | |
:return: cookie |
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
{ | |
"configResolveDn": { | |
"@cookie": "1507473235/8a7ba0ec-5b0a-1b0a-8012-ee768522e470", | |
"@response": "yes", | |
"@dn": "sys", | |
"outConfig": { | |
"topSystem": { | |
"@dn": "sys", | |
"@address": "192.168.1.56", | |
"@currentTime": "Sun Oct 8 14:34:27 2017 ", |
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
<?xml version="1.0" ?> | |
<configResolveDn cookie="1507473235/8a7ba0ec-5b0a-1b0a-8012-ee768522e470" dn="sys" response="yes"> | |
<outConfig> | |
<topSystem address="192.168.1.56" currentTime="Sun Oct 8 14:34:27 2017 " dn="sys" localTime="Sun Oct 8 14:34:27 2017 UTC +0000" mode="stand-alone" name="C220-FCH1941V3BX" timeZone="UTC"> | |
<computeRackUnit adaptorSecureUpdate="Enabled" adminPower="policy" assetTag="Unknown" availableMemory="393216" bmcResetStatus="NA" cimcResetReason="ac-cycle " memorySpeed="1866" model="UCSC-C220-M4S" name="UCS C220 M4S" numOfAdaptors="2" numOfCores="20" numOfCoresEnabled="20" numOfCpus="2" numOfEthHostIfs="4" numOfFcHostIfs="4" numOfThreads="40" operPower="on" originalUuid="DCC513C2-7FA4-4D0B-8E2D-A0C1E56A1A47" presence="equipped" resetComponents="components" rn="rack-unit-1" serial="FCH1941V3BX" serverId="1" storageResetStatus="NA" totalMemory="393216" usrLbl="" uuid="DCC513C2-7FA4-4D0B-8E2D-A0C1E56A1A47" vendor="Cisco Systems Inc" vicResetStatus="NA"> | |
<adaptorUnit adminS |