Exemple #1
0
 def __init__(self, octopusd, paramter) :
     self.paramter = paramter
     self.octopusd = octopusd
     if paramter and paramter.get('hostname') :
         self.hostname = paramter.get('hostname')
     else :
         self.hostname = Host.getHostname()
    def __init__(self, octopusd, paramter):
        self.paramter = paramter
        self.octopusd = octopusd
        self.filters = paramter.get('filters')
        self.bss = paramter.get('bss')

        if paramter and paramter.get('hostname'):
            self.hostname = paramter.get('hostname')
        else:
            self.hostname = Host.getHostname()

        if paramter and paramter.get('containername'):
            self.containername = paramter.get('containername')
        else:
            self.containername = "{{name}}"

        if paramter and paramter.get('instance'):
            self.instance = paramter.get('instance')
        else:
            self.instance = None

        #if paramter and paramter.get('interval_time') :
        #    self.interval_time = paramter.get('interval_time')
        #else :
        #    self.interval_time = 0.5

        self.cacheStatsList = None
        self.cacheStatsTime = None
    def __init__(self, octopusd, paramter):
        self.paramter = paramter
        self.octopusd = octopusd
        self.filters = paramter.get('filters')
        self.bss = paramter.get('bss')

        if paramter and paramter.get('hostname'):
            self.hostname = paramter.get('hostname')
        else:
            self.hostname = Host.getHostname()

        if paramter and paramter.get('containername'):
            self.containername = paramter.get('containername')
        else:
            self.containername = "{{name}}"

        if paramter and paramter.get('instance'):
            self.instance = paramter.get('instance')
        else:
            self.instance = None

        #if paramter and paramter.get('interval_time') :
        #    self.interval_time = paramter.get('interval_time')
        #else :
        #    self.interval_time = 0.5

        #{containerid:{cachetime:time, cachemap:{variabels:{},global_status:{}}}}
        self.status_cache = {}
Exemple #4
0
def getHostname():
    try:
        hostUtil = HostUtil()
        message = hostUtil.getHostname()

    except Exception, e:
        message = "error get hostname, Ex:%s" % str(e)
        return Response.make_json_response(message, success=False, code=-1)