FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

os:windows:wincheck:index.html



This is an old revision of the document!


Top#OS Management

Windows Check (wincheck.py)

$FHHOME/fabfile/wincheck.py


Operation

$ fab  -l |grep wincheck.
$ echo xx.xx.xx.xx | fab  auth.pro  wincheck.xxxx

Ref. Remote Shell Commands

$ echo xx.xx.xx.xx | fab auth.pro -- hostname
$ echo xx.xx.xx.xx | fab auth.pro -- sudo cat /etc/shadow


wincheck.py

$FHHOME/fabfile/wincheck.py

import sys
from fabric.api import *
from fabric.contrib import files
from fabric.operations import open_shell

FHHOME=os.environ["FHHOME"]


#------------------------------------------------------------------
# wincheck.ipconfig_all
#------------------------------------------------------------------
@task
def ipconfig_all():
    env.shell = "Cmd.exe /C"
    run("ipconfig /all")


#------------------------------------------------------------------
# wincheck.powershell_version
#------------------------------------------------------------------
@task
def powershell_version():
    env.shell = "PowerShell.exe -Command"
    run($PSVersionTable)







Top#OS Management



os/windows/wincheck/index.html.1517326410.txt.gz ยท Last modified: 2018/01/31 00:33 by kurihara