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:winope:index.html



This is an old revision of the document!


Top#OS Management

Windows Operation (winope.py)

$FHHOME/fabfile/winope.py


Operation

$ fab  -l |grep winope
$ echo xx.xx.xx.xx | fab  auth.pro  winope.xxxx
$ echo xx.xx.xx.xx | fab  auth.pro  winope.cmd:hostname

Ref. Remote Shell Commands

$ fab -H xx.xx.xx.xx -u USER -p PASSWORD --shell="Cmd.exe /C" --no-pty -- hostname
$ echo xx.xx.xx.xx | fab auth.winpro --shell="Cmd.exe /C" --no-pty  -- ipconfig /all


winope.py

$FHHOME/fabfile/winope.py

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

FHHOME=os.environ["FHHOME"]


#------------------------------------------------------------------
# winope.cmd
#------------------------------------------------------------------
@task
def cmd(cmd):
    """winope.cmd:hostname"""
    run("%s" % cmd, shell=False, pty=False)

#------------------------------------------------------------------
# winope.powershell:$PSVersionTable
#------------------------------------------------------------------
@task
def powershell(cmd):
    """winope.powershell:$PSVersionTable"""
    run("PowerShell.exe -Command %s" % cmd, shell=False, pty=False)


#------------------------------------------------------------------
# winope.put:
#------------------------------------------------------------------
@task
def put(local, remote):
    """ winope.put:local,remote  # /tmp/test.txt C:\\tmp\\ """
    put("%s" % local, "%s" % remote)

#------------------------------------------------------------------
# winope.get:
#------------------------------------------------------------------
@task
def get(remote, local):
    """ winope.get:remote, local # C:\\tmp\\test.txt , /tmp/ """
    get("%s" % remote, "%s" % local)






Top#OS Management



os/windows/winope/index.html.1517493322.txt.gz ยท Last modified: 2018/02/01 22:55 by kurihara