Package: f5-agent-auditor
QuickstartDescription:f5-agent-auditor主要用于检查审计f5-openstack-agent在Neutron DB中创建的资源和其下发到 BigIP 上的资源是否一致。检查资源的范围包含：BigIP partiton (Openstack project)BigIP vip (Openstack loadbalancer)BigIP vs (Openstack listener)BigIP pool (Openstack pool)BigIP pool mebmer (Openstack pool member)检查级别：每次检查f5-agent-auditor需要指定agent id（--f5-agent）作为命令参数，f5-agent-auditor会检查agent id指定的 agent 在 BigIP 上创建的所有资源。通常情况下一个agent id对应一个 Neutron LBaaS 的service provider，也可以理解为f5-agent-auditor会检查agent id指定的service provider创建的所有资源。Installation安装方式主要提供从原码安装和使用pip命令从PYPI库安装。Install by source code# 从 github 上下载原码gitclonehttps://github.com/zhang-shengping/f5-agent-auditor.git-bmaster# 转到源码目录下cdf5-agent-auditor# 使用 pip 安装sudopipinstall./# 或者 setup.py 安装，任意一种即可。sudopythonsetup.pyinstallInstall from PYPI repository# 直接从 PYPI 仓库安装[stack@neutron-server-1~]$sudopipinstallf5-agent-auditor以上安装方式使用任意一种即可Uninstallation卸载可以直接使用pip命令卸载# 卸载 f5-agent-auditor[stack@neutron-server-1~]$sudopipuninstallf5-agent-auditor
Uninstallingf5-agent-auditor-0.0.0:/usr/bin/f5-agent-auditor/usr/lib/python2.7/site-packages/f5-agent-auditor.egg-link
Proceed(y/n)?ySuccessfullyuninstalledf5-agent-auditor-0.0.0Execution安装后，命令f5-agent-auditor会被安装到系统中.# 运行如下命令。f5-agent-auditor--config-file/etc/neutron/services/f5/f5-openstack-agent-CORE.ini--config-file/etc/neutron/neutron.conf--f5-agent1b4e247d-6c79-4d38-949f-91af99b10b2c**--f5-agent：**指定需要检查审计的F5 LBaaS Agent UUID, Openstack admin 用户可以使用neutron agent-list查看。**--config-file：**需要指定两个 file，一个是 neutron-server 的neutron.conf配置文件。一个是选取的 F5 LBaaS Agent 使用的f5-openstack-agent.ini配置文件（比如f5-openstack-agent-CORE.ini）。# 将 neutron.conf debug 配置修改为 False，程序运行时可以输出比较简洁的 log，如下：[stack@neutron-server-1f5-agent-auditor]$f5-agent-auditor--config-file/etc/neutron/services/f5/f5-openstack-agent-CORE.ini--config-file/etc/neutron/neutron.conf--f5-agent1b4e247d-6c79-4d38-949f-91af99b10b2c
INFOf5_agent_auditor.collector.lbaas_collector[-]Getprojectsofagent:1b4e247d-6c79-4d38-949f-91af99b10b2cinNeutronDB
INFOf5_agent_auditor.collector.lbaas_collector[-]get_projects_on_devicetakes0.000581026077271seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getprojectsondevice10.145.67.245
INFOf5_agent_auditor.collector.bigip_collector[-]get_projects_on_devicetakes0.0221989154816seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getloadbalancersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_loadbalancerstakes0.000296115875244seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getloadbalancersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_loadbalancerstakes0.000241994857788seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getloadbalancersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_loadbalancerstakes0.0236790180206seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getloadbalancersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_loadbalancerstakes0.0187258720398seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getlistenersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_listenerstakes0.00666093826294seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getlistenersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_listenerstakes0.00414395332336seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getlistenersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_listenerstakes0.0253779888153seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getlistenersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_listenerstakes0.0208730697632seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]Setpoolmembersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000219106674194seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]set_project_pool_memberstakes0.0171270370483seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.0379309654236seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]Setpoolmembersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000220060348511seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]set_project_pool_memberstakes0.00769901275635seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.0190608501434seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0208911895752seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0172410011292seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000191926956177seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000253915786743seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0212268829346seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0178661346436seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getprojectsondevice10.145.75.98
INFOf5_agent_auditor.collector.bigip_collector[-]get_projects_on_devicetakes0.0180327892303seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getloadbalancersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_loadbalancerstakes0.000180959701538seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getloadbalancersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_loadbalancerstakes0.000140905380249seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getloadbalancersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_loadbalancerstakes0.0210061073303seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getloadbalancersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_loadbalancerstakes0.0160021781921seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getlistenersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_listenerstakes0.000160932540894seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getlistenersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_listenerstakes0.000134944915771seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getlistenersofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_listenerstakes0.0203671455383seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getlistenersofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_listenerstakes0.0223190784454seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000166177749634seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000140905380249seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0195679664612seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0202949047089seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000195026397705seconds
INFOf5_agent_auditor.collector.lbaas_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.lbaas_collector[-]get_project_poolstakes0.000169992446899seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:346052548d924ee095b3c2a4f05244ac
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0196969509125seconds
INFOf5_agent_auditor.collector.bigip_collector[-]Getpoolsofproject:57e89acdfb6e40a2bc7f6185645dbbdd
INFOf5_agent_auditor.collector.bigip_collector[-]get_project_poolstakes0.0193870067596seconds
INFOf5_agent_auditor.auditor[-]maintakes0.994650840759secondsEvaluation如果一个 F5 LBaaS Agent 控制多个 BigIP 机器（比如 HA 一对 BigIP 设备），且 Neutron DB 中有些数据在某些 BigIP 检查不到，那么f5-agent-auditor程序运行完后，会在 Linux OS 的/tmp目录下产生<bigip_hostname>.csv文件，记录丢失的 resource 和其状态。如下：# 文件名称如下：# /tmp/check_10.145.67.245.csv# /tmp/check_10.145.75.98.csv[stack@neutron-server-1f5-agent-auditor]$cat/tmp/check_10.145.67.245.csv
resourcetype,uuid,provisioningstatus,projectid,poolid,detail
loadbalancer,4a7ebe71-a13b-4257-bc3f-c67bba87bbb8,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
loadbalancer,76038dff-4438-4afa-9068-9c5905db8582,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
loadbalancer,36638069-1c7b-4a33-9fe5-5238f947793d,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
listener,8477ba31-0c52-477b-aba0-99babdb3f3c1,ERROR,346052548d924ee095b3c2a4f05244ac,,
listener,b015d913-c996-443f-b332-33146514341e,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
listener,9b0f0962-6455-43e0-86ee-50800d392243,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
pool,7640844c-115c-4145-869c-7e88d5b14c70,ACTIVE,57e89acdfb6e40a2bc7f6185645dbbdd,,
pool,061408d4-3d57-4317-8b35-8ee2eb3d2f18,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
pool,a32cf197-aef2-4c04-86ac-2f4fae825a79,ACTIVE,57e89acdfb6e40a2bc7f6185645dbbdd,,
pool,8755a316-b066-4194-b31c-91fec94c7d47,ACTIVE,346052548d924ee095b3c2a4f05244ac,,
member,856204a3-44aa-4669-929f-2104a0fc5124,ACTIVE,57e89acdfb6e40a2bc7f6185645dbbdd,7640844c-115c-4145-869c-7e88d5b14c70,"{'port': u'123', 'address': u'192.168.2.123'}"member,ec27fb36-daec-4f96-beb8-b4fb50d5f0f4,ACTIVE,346052548d924ee095b3c2a4f05244ac,8755a316-b066-4194-b31c-91fec94c7d47,"{'port': u'124', 'address': u'172.168.2.124'}"member,f157fcb0-77b2-47e4-9870-bb6574eba252,ACTIVE,346052548d924ee095b3c2a4f05244ac,8755a316-b066-4194-b31c-91fec94c7d47,"{'port': u'125', 'address': u'172.168.2.125'}"member,0cb89299-4d18-4e18-bd77-ee4e2fedf166,ACTIVE,346052548d924ee095b3c2a4f05244ac,061408d4-3d57-4317-8b35-8ee2eb3d2f18,"{'port': u'123', 'address': u'172.168.1.213'}"<bigip_hostname>.csv文件可以通过Execel打开查看，做后续整理。