예제 #1
0
def client():
    if settings.MODE == 'AGENT':
        cli = AutoAgent()
    elif settings.MODE == 'SSH':
        cli = AutoSSH()
    elif settings.MODE == 'SALT':
        cli = AutoSalt()
    else:
        raise Exception('请配置资产采集模式,如:ssh、agent、salt')
    cli.process()
예제 #2
0
def client():
    if settings.MODE == 'agent':
        cli = AutoAgent()
    elif settings.MODE == 'ssh':
        cli = AutoSSH()
    elif settings.MODE == 'salt':
        cli = AutoSalt()
    else:
        raise Exception('请配置资产采集模式,如:ssh、agent、salt')
    ret = cli.process()
    return ret
예제 #3
0
def client():
    if settings.MODE == 'agent':
        cli = AutoAgent(url=settings.API_URL)
    elif settings.MODE == 'ssh':
        cli = AutoSSH()
    elif settings.MODE == 'salt':
        cli = AutoSalt()
    else:
        raise Exception('请配置资产采集模式,如:ssh、agent、salt')

    cli.process()
예제 #4
0
def update_client():
    if settings.MODE == 'agent':
        cli = AutoAgent(url=settings.UP_API_URL)
    elif settings.MODE == 'ssh':
        cli = AutoSSH()
    elif settings.MODE == 'salt':
        cli = AutoSalt()
    else:
        raise Exception('请配置资产采集模式,如:ssh、agent、salt')

    ret = cli.process()
    print(ret)
예제 #5
0
def client():
    if settings.MODE == "ssh":
        if os == "linux":
            res = AutoSSH()
        elif os == "Darwin":
            res = AutoSSH()

        elif os == "windows":
            pass
        else:
            print("Only these three operating systems are supported")
        pass

    elif settings.MODE == "agent":
        if os == "linux":
            pass
        elif os == "Darwin":
            pass
        elif os == "windows":
            pass
        else:
            print("Only these three operating systems are supported")
        pass
    elif settings.MODE == 'slat':
        if os == "linux":
            pass
        elif os == "Darwin":
            pass
        elif os == "windows":
            pass
        else:
            print("Only these three operating systems are supported")
        pass
    else:
        print("Does not support")
    pass
    res.proess()
예제 #6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __author__= 'luhj'
from src.client import AutoAgent
from src.client import AutoSalt
from src.client import AutoSSH
from config import settings

def client()
    if settings.MODE == 'agent':
        cli = AutoAgent()
    elif settings.MODE == 'ssh':
        cli = AutoSSH()
    elif settings.MODE == 'salt':
        cli = AutoSalt()
    else:
        raise Exception('资产采集模式配置错误[ssh,agent,salt]')
    cli.process()