• python 查看poolmemebr 状态信息


    AFAT1:~/sbin # cat view_poolmember_status.py 
    # -*- coding: utf-8 -*-
    import sys
    import time
    import csv
    import ssl
    reload(sys)
    sys.path.append('./pycontrol')
    import pycontrol.pycontrol as pc
    #ssl._create_default_https_context = ssl._create_unverified_context
    if len(sys.argv) != 5:
        print sys.argv[0] + ' ' + 'f5managedip' + ' ' + 'username' + ' ' + 'passwd' + ' ' + 'poolname'
    else :
    poolname = sys.argv[4]
    a = pc.BIGIP(
      hostname = sys.argv[1],
      username = sys.argv[2],
      password = sys.argv[3],
      fromurl = True,
       wsdls=['LocalLB.PoolMember'])
    pool01 = a.LocalLB.PoolMember
    b= pool01.get_object_status(pool_names=[poolname])
    for x in b:
        for y in x:
            print y.member.address+'=>'+str(y.member.port)+'=>'+y.object_status.availability_status+'=>'+y.object_status.enabled_status+'=>'+y.object_status.status_description
    AFAT1:~/sbin # python view_poolmember_status.py  '10.4.170.160'  'zjtlcb' '12345678' 'ESB_huigui_pool' 
    10.4.160.127=>0=>AVAILABILITY_STATUS_GREEN=>ENABLED_STATUS_ENABLED=>Pool member is available
    10.4.161.57=>0=>AVAILABILITY_STATUS_GREEN=>ENABLED_STATUS_ENABLED=>Pool member is available
    AFAT1:~/sbin # 
    
  • 相关阅读:
    分分钟用上C#中的委托和事件
    AutoResetEvent详解
    C#跨线程调用
    多线程编程的注意事项
    C#中WinForm程序退出方法技巧总结
    用c#实现单链表(程序代码已经验证,完全正确)
    event & EventHandler
    Kubernetes理论02
    centos7 日志文件
    CentOS7 FTP安装与配置
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348670.html
Copyright © 2020-2023  润新知