NorthStar 与 HealthBot 集成
概述
NorthStar 控制器和 HealthBot 产品的集成是一项正在进行的开发工作,正在分阶段发布。本主题介绍 NorthStar 控制器 5.1.0 版与 HealthBot 2.1 版的集成状态。
NorthStar 控制器可以在并行安装方案中使用 HealthBot 作为其分析收集器。您可以独立安装和管理 NorthStar 和 HealthBot,但在 NorthStar 中配置一些分析收集器功能,由 HealthBot 而不是 Elasticsearch 处理。从 NorthStar 控制器版本 5.1.0 开始,仅支持瞻博网络节点(而不是多供应商支持),并且 HealthBot 只能处理以下分析集合:
Junos 遥测接口 (JTI) LSP 统计信息
JTI 接口统计信息(逻辑和物理)
使用 RPM 探测器的链路延迟统计信息
使用 LDP 命令的 LDP show 需求统计
图 1 总结了 HealthBot 和 NorthStar 组件之间的关系。这些数字对应于以下过程:
NorthStar 将设备列表和配置文件信息推送到 HealthBot。
NorthStar 为 HealthBot 提供了一组用于从网络设备收集数据的规则。
NorthStar 规则使 HealthBot 能够自动通知 NorthStar 有关通过 AMQP 收集实时样本数据的信息。
NorthStar node.js和 NorthStar 报告生成器根据 jinja 模板查询 HealthBot 数据库。
HealthBot 中的统计数据和数据可在 NorthStar UI 或其他北向界面 (NBI) 中查看。
![NorthStar Controller/HealthBot Integration](/documentation/us/en/software/northstar6.2.0/northstar-controller-user-guide/images/g300778.png)
有关规则和操作手册以及一般 HealthBot 操作的信息,请参阅 HealthBot 文档。我们提供了以下基本的 HealthBot 术语以供参考。
HealthBot 术语 |
描述 |
---|---|
规则 |
从网络或 Junos 设备提取特定信息所需的组件或块包。规则符合为分析应用程序量身定制的域特定语言 (DSL)。 |
剧本 |
用于解决特定用例的规则集合。 |
剧本实例 |
应用于设备或网络组的剧本的特定实例。 |
用户定义函数 (UDF) |
用户定义的函数在规则内部使用。 |
使用 NorthStar 数据收集规则和操作手册更新 HealthBot
若要准备 HealthBot 以向 NorthStar 提供收集数据,请执行以下步骤。
确认 HealthBot 服务已启动并正在运行。
在 HealthBot 服务器上安装 python3 模块请求和 pika。例如:
pip3 install requests; pip3 install pika
将 NorthStar 规则从 NorthStar 应用程序服务器复制到 HealthBot 服务器上的临时目录。
[root@northstar]# cp /opt/northstar/northstar_bundle_x.x.x/hb_config/hb-rules-config.tar.gz /var/tmp
在 HealthBot 服务器上,解压缩规则文件。
[root@healthbot]# tar xvf hb-rules-config.tar.gz
在 HealthBot 服务器上,运行将 NorthStar 规则和剧本插入 HealthBot 的脚本,使其在 HealthBot UI 中可见,并更新 NorthStar 的用户定义函数 (UDF)。此脚本还会获取 NorthStar 与 HealthBot 之间通信所需的凭据。
[root@healthbot]:~/ns/installation# ./install-ns-rules.sh
该脚本会提示您输入:
NorthStar 服务器 IP 或 VIP 地址或主机名
NorthStar 管理员用户名和密码
HealthBot 应用服务器 IP 地址
HealthBot 管理员用户名和密码
您将看到脚本的进度:
root@healthbot:~/ns/installation# ./install-ns-rules.sh Copying config file /opt/northstar/data/northstar.cfg from Northstar APP server, Please enter below info --------------------------------------------------------------------------------------------------------- Please enter Northstar application server IP/VIP address or host name: 10.53.64.97 Please enter Northstar Web Admin username: admin Please enter Northstar Web Admin password: Please enter HealtBot application server IP address: 10.53.64.96 Please enter HealthBot Web Admin username: admin Please enter HealthBot Web Admin password: retrieving config file from application server... Saving to /root/ns/input/northstar.cfg Copying NS input files to /var/local/healthbot/input Starting Northstar rules and playbook upload/creation Rule/yml file directory: /root/ns/rules Successfully import the yml file: ns-ldp-demand-stats.yml Successfully import the yml file: ns-rpm-probe-ifl.yml Successfully import the rule file: ns-jti-logical-interface.rule Successfully import the rule file: ns-jti-label-switched-path.rule Successfully import the rule file: ns-ldp-demand-stats.rule Successfully import the rule file: ns-jti-physical-interface.rule Successfully import the rule file: ns-rpm-probe-ifl.rule Successfully created the playbook: "northstar" Updating UDF.... Running /root/ns/installation/udf-config.sh in iagent engine.. Success! See /tmp/.iagent_modification.log for logs Running /root/ns/installation/udf-config.sh in jtimon engine.. Success! See /tmp/.jtimon_modification.log for logs Running /root/ns/installation/udf-config.sh in fluentd engine.. Success! See /tmp/.fluentd_modification.log for logs Running /root/ns/installation/udf-config.sh in telegraf engine.. Success! See /tmp/.telegraf_modification.log for logs Running /root/ns/installation/udf-config.sh in itsdb engine.. Success! See /tmp/.itsdb_modification.log for logs
通过在 HealthBot 服务器上运行以下脚本来验证 HealthBot 和 NorthStar 之间的连接。
[root@healthbot]# /ns_config/installation/ns_setup.py -t Test connectivity with input/northstar.cfg # mq_host=10.53.64.97 mq_port=5672 mq_username=northstar mq_password_enc=eF0A0DhJ0GiKcHlAfEnFgMpB Connected to rabbitmq on 10.53.64.97 successfully
成功完成脚本后,您应该能够在 HealthBot UI 中看到 NorthStar 规则,如图 2 所示。
![NorthStar Rules in the HealthBot UI](/documentation/us/en/software/northstar6.2.0/northstar-controller-user-guide/images/s007713.png)
您还可以确认 NorthStar 行动手册是否可见,如图 3 所示。
![NorthStar Playbook in the HealthBot UI](/documentation/us/en/software/northstar6.2.0/northstar-controller-user-guide/images/s007714.png)
单击 NorthStar 操作手册,查看 NorthStar 规则与操作指南相关联,如图 4 所示。如果需要,您可以从此处删除规则。
![NorthStar Rules in the NorthStar Playbook](/documentation/us/en/software/northstar6.2.0/northstar-controller-user-guide/images/s007715.png)
配置 NorthStar 端
若要使 NorthStar 准备好从 HealthBot 接收分析数据,请执行以下步骤。
通过使用 config-healthbot-collector 选项运行 net_setup.py 脚本,将集合类型从默认 (Elasticsearch) 更改为 HealthBot。
[root@northstar]# /opt/northstar/utils/net_setup.py --config-healthbot-collector
该脚本会提示您确认是否要进行更改,然后要求您提供以下信息:
HealthBot Web 服务器 IP 地址
HealthBot UI 用户名和密码
HealthBot 数据库 IP 地址(通常与 HealthBot Web 服务器 IP 地址相同)
然后,该脚本将更新配置文件并重新启动 NorthStar Web 服务器。该过程完成后,将显示一条成功消息。
使用 NorthStar CLI 配置 HealthBot 相关参数:
[root@ns1 root]# /opt/northstar/utils/cmgd_cli root@ns1> edit Entering configuration mode [edit] root@ns1# set northstar analytics healthbot openconfig-port 32767 [edit] root@ns1# set northstar analytics healthbot iagent-port 830 [edit] root@ns1# set northstar analytics healthbot native-port 4000 [edit] root@ns1# set northstar analytics healthbot device-group-name northstar [edit] root@ns1# set northstar analytics healthbot playbook-name northstar [edit] root@ns1# set northstar analytics healthbot playbook-instance ns [edit] root@ns1# set northstar analytics healthbot rules northstar/juniper-jti-label- switched-path,northstar/juniper-jti-logical-interface,northstar/juniper-jti- physical-interface,northstar/juniper-ldp-demand-stats,northstar/juniper-rpm-probe-ifl; [edit] root@ns1# commit root@ns1# exit Exiting configuration mode root@ns1> show configuration northstar analytics healthbot openconfig-port 32767; iagent-port 830; native-port 4000; device-group-name northstar; playbook-name northstar; playbook-instance ns; rules northstar/juniper-jti-label-switched-path,northstar/juniper-jti-logical- interface,northstar/juniper-jti-physical-interface,northstar/juniper-ldp-demand- stats,northstar/juniper-rpm-probe-ifl;
配置网络中的每个瞻博网络设备,以将 JTI 和 RPM 探测数据发送到 HealthBot 服务器。有关说明,请参阅 配置路由器以将 JTI 遥测数据和 RPM 统计信息发送到数据收集器 。
在 NorthStar UI 中,导航到 Administration “> Device Profile ”,将设备配置文件信息推送到 HealthBot 并应用 NorthStar playbook 实例。
由于您将集合类型设置为 HealthBot,因此 NorthStar UI 中的“设备配置文件”窗口包含一个用于将设备更新到 HealthBot 的按钮,如图 5 所示。
图5:带有“更新设备”按钮的设备配置文件窗口
在单击按钮之前,您无需选择设备 - 单击该按钮会将由 NorthStar 管理的所有瞻博网络设备的所有设备信息更新为 HealthBot。该过程完成后,您将看到一条成功消息。
您可以通过查看 HealthBot UI 仪表板(位于“设备”下)来验证设备信息是否已与 HealthBot 共享,如图 6 所示。所有推送到 HealthBot 的瞻博网络设备都列在那里。单击任何一个设备名称可在弹出窗口中查看配置文件信息的详细信息。
图 6:HealthBot 仪表板中的 NorthStar 设备
另请注意, 在图 6 中,创建了一个 NorthStar 设备组(最左侧)。单击组的名称可查看已将其信息推送到 HealthBot 的所有设备的列表。
在 HealthBot UI 的 Playbook 下,您可以确认已创建 NorthStar playbook 实例,如图 7 所示。显示屏指示剧本的一个实例正在运行。
图 7:HealthBot UI中的 NorthStar Playbook 实例
单击 playbook 名称旁边的箭头可查看实例的详细信息,包括其设备组、设备和规则。
在 NorthStar UI 中查看数据
在 NorthStar UI 中查看收集的数据与 HealthBot 作为收集类型没有什么不同,只是在 NorthStar/HealthBot 集成的此阶段存在一些限制。尚不支持以下各项:
总 LSP 流量图表
LSP、节点、接口和接口延迟图表的主要流量
网络流集合
SR 统计信息(SID 流量)
按需报告和需求组报告
注意:这些报告可以使用 Elasticsearch 原生集合获得。