• python 获取pool 成员状态


    import sys
    import pycontrol.pycontrol as pc
    import time
    import csv
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context
    pool='ESB_huigui_pool'
    arr=[]
    b = pc.BIGIP(
    hostname = '10.1.10.160',
    username = 'aaa',
    password = '123456',
    fromurl = True,
        wsdls=['LocalLB.PoolMember'])
    pools = b.LocalLB.PoolMember
    print pools
    print dir(pools)
    
    print dir(pools)
    a= pools.get_object_status(pool_names=[pool])
    print type(a)
    for x in a:
        print '1111111111111111'
        print x
        print type(x)
        print '2222222222222222'
        for y in x:
            print y
            print type(y)
            print dir(y)
            print  y.member
            print type(y.member)
            print y.member.address +':'+ str(y.member.port)
            print y.object_status
            print dir(y.object_status)
            print y.member.address +':'+ str(y.member.port)+'=>'+y.object_status.availability_status +'=>'+y.object_status.enabled_status+'=>'+y.object_status.status_description
            arr.append(y.member.address +':'+ str(y.member.port)+'=>'+y.object_status.availability_status +'=>'+y.object_status.enabled_status+'=>'+y.object_status.status_description)
    print '-----------------------------------------------------------------------------------------------------------------------------------------------------'
    print arr
    
    
    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    [10.4.160.127:0=>AVAILABILITY_STATUS_GREEN=>ENABLED_STATUS_ENABLED=>Pool member is available, 10.4.161.57:0=>AVAILABILITY_STATUS_RED=>ENABLED_STATUS_ENABLED=>Pool member has been marked down by a monitor]
    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    [10.4.160.127:0=>AVAILABILITY_STATUS_RED=>ENABLED_STATUS_DISABLED=>Forced down, 10.4.161.57:0=>AVAILABILITY_STATUS_RED=>ENABLED_STATUS_ENABLED=>Pool member has been marked down by a monitor]
    
    
    [10.4.160.51:7013=>AVAILABILITY_STATUS_RED=>ENABLED_STATUS_ENABLED=>Pool member has been marked down by a monitor, 10.4.160.52:7013=>AVAILABILITY_STATUS_BLUE=>ENABLED_STATUS_ENABLED=>Pool member does not have service checking enabled]
    
    Process finished with exit code 0
    
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    [10.4.160.51:7001=>AVAILABILITY_STATUS_RED=>ENABLED_STATUS_DISABLED=>Forced down, 10.4.160.52:7001=>AVAILABILITY_STATUS_GREEN=>ENABLED_STATUS_ENABLED=>Pool member is available]
  • 相关阅读:
    数据结构总结——线段树
    [bzoj2131]免费的馅饼 树状数组优化dp
    [机房练习赛7.26] YYR字符串
    博客已搬家
    AFO
    COGS-2551 新型武器
    UVALive-3716 DNA Regions
    UVALive-4850 Installations
    UVALive-3983 Robotruck
    UVA-10859 Placing Lampposts
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348970.html
Copyright © 2020-2023  润新知