config
您必须使用 sudo 权限运行 netq config
命令。
netq config add agent cluster-servers
配置服务器集群,受监控的交换机和主机上的 NetQ Agent 应将它们收集的数据发送到该集群。您还可以提供特定的端口或 VRF 用于通信。请注意,您必须重启 NetQ Agent 才能启用配置。
语法
netq config add agent cluster-servers
<text-opta-ip-list>
[port <text-opta-port>]
[vrf <text-vrf-name>]
[ssl true | ssl false]
[ssl-cert <text-ssl-cert-file> | ssl-cert download]
必需参数
参数 | 值 | 描述 |
---|---|---|
NA | <text-opta-ip-list> | 服务器集群中要包含的交换机的 IP 地址或主机名的逗号分隔列表(无空格) |
选项
选项 | 值 | 描述 |
---|---|---|
port | <text-opta-port> | 使用每个交换机上具有此名称的端口来接收数据;默认端口为 31980 |
vrf | <text-vrf-names> | 使用每个交换机上具有此名称的 VRF 来接收数据;默认 VRF 为default |
ssl | true, false | 在 agent 和 OPTA 之间建立 SSL 连接 (true) |
ssl-cert | <text-ssl-cert-file> | 使用此文件中包含的 SSL 证书。值必须包含文件的完整路径。 |
ssl-cert download | NA | 下载 SSL 证书 |
使用示例
配置具有默认端口和 VRF 的集群
cumulus@switch:~$ netq config add agent cluster-servers leaf01,leaf02,spine01
Updated agent for cluster servers leaf01,leaf02,spine01 port 31980 vrf default. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
相关命令
netq config del agent cluster-servers
netq config restart agent
netq config add agent command
NetQ Agent 包含一组预配置的模块化命令,这些命令定期运行并将事件和资源数据发送到 NetQ 设备或 VM。此命令允许您微调 agent 可以轮询哪些事件,并更改轮询频率。请注意,您必须重启 NetQ Agent 才能启用配置。
有关更多详细信息,包括服务密钥和默认轮询间隔,请参阅管理 NetQ Agent。
语法
netq config add agent command
service-key <text-service-key-anchor>
[poll-period <text-cmd-periodicity>]
[command <text-cmd-text>]
[enable True | enable False]
必需参数
参数 | 值 | 描述 |
---|---|---|
service-key | <text-service-key-anchor> | 使用此服务密钥(名称)修改 NetQ Agent 命令 |
选项
选项 | 值 | 描述 |
---|---|---|
poll-period | <text-cmd-periodicity> | 为具有指定服务密钥的 NetQ Agent 命令设置轮询周期(秒) |
command | <text-cmd-text> | 为具有指定服务密钥的 NetQ Agent 命令运行此可执行命令 |
enable | True, False | 启用 (True) 或禁用 (False) 具有指定服务密钥的 NetQ Agent 命令 |
使用示例
例如,要将 ntp
命令的轮询频率从默认的 30 秒更改为 60 秒,请运行
cumulus@switch:~$ sudo netq config add agent command service-key ntp poll-period 30
Successfully added/modified Command service misc command None
cumulus@switch:~$ sudo netq config show agent commands
Service Key Period Active Command Timeout
----------------------- -------- -------- -------------------------------------------------------------- ---------
bgp-neighbors 60 yes ['/usr/bin/vtysh', '-c', 'show ip bgp vrf all neighbors json'] 30
evpn-vni 60 yes ['/usr/bin/vtysh', '-c', 'show bgp l2vpn evpn vni json'] 30
lldp-json 120 yes /usr/sbin/lldpctl -f json 30
clagctl-json 60 yes /usr/bin/clagctl -j 30
mstpctl-bridge-json 60 yes /sbin/mstpctl showall json 30
ports 3600 yes Netq Predefined Command 30
proc-net-dev 30 yes Netq Predefined Command 30
dom 1800 yes Netq Predefined Command 30
roce 60 yes Netq Predefined Command 30
roce-config 300 yes Netq Predefined Command 30
nvue-roce-config 300 yes Netq Predefined Command 30
ntp 30 yes Netq Predefined Command 45
agent_stats 300 yes Netq Predefined Command 30
agent_util_stats 300 yes Netq Predefined Command 30
tcam-resource-json 300 yes /usr/cumulus/bin/cl-resource-query -j 30
nvue-mon-json 300 yes Netq Predefined Command 30
cl-support-json 3600 yes Netq Predefined Command 30
resource-util-json 300 yes findmnt / -n -o FS-OPTIONS 30
smonctl-json 120 yes /usr/sbin/smonctl -j 30
sensors-json 1800 yes sensors -u 30
ssd-util-json 86400 yes /usr/sbin/smartctl -a /dev/sda 30
ssd-util-nvme-json 86400 yes /usr/sbin/smartctl -a /dev/nvme0 30
ecmp-hash-info 300 yes cat /etc/cumulus/datapath/traffic.conf 30
ecmp-info 60 yes Netq Predefined Command 30
ptp-config-info 60 yes cat /etc/ptp4l.conf 30
ptp-clock-info 60 yes Netq Predefined Command 30
ptp-clock-status 60 yes Netq Predefined Command 30
ptp-statistics 60 yes Netq Predefined Command 30
ptp-correction 30 yes Netq Predefined Command 30
log-exporter 60 yes Netq Predefined Command 30
adaptive-routing-config 300 yes Netq Predefined Command 30
ber-info 30 yes Netq Predefined Command 30
禁用命令
cumulus@switch:~$ netq config add agent command service-key ntp enable False
Command Service ntp is disabled
相关命令
netq config show agent
netq config agent factory-reset
netq config add agent cpu-limit
配置 NetQ Agent 以使用不超过交换机 CPU 资源指定的最大百分比(介于 40% 到 60% 之间)。如果您在不带值的情况下运行该命令,NetQ 假定限制为 40%。交换机上必须运行 Cumulus Linux 3.6 或更高版本或 4.1.0 或更高版本,此设置才能生效。请注意,您必须重启 NetQ Agent 才能启用配置。
有关此功能的更多详细信息,请参阅此知识库文章。
语法
netq config add agent cpu-limit
[<text-limit-number>]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
NA | <text-limit-number> | 设置 NetQ Agent 可以使用的 CPU 资源最大百分比的阈值 |
使用示例
将 NetQ Agent 的 CPU 使用率限制为 60%
cumulus@switch:~$ netq config add agent cpu-limit 60
Successfully set agent CPU limit to 60
Please restart agent(netq config restart agent)
'netq-agent'
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config show agent cpu-limit
netq config del agent cpu-limit
netq config restart agent
netq config add agent frr-monitor
配置 NetQ Agent 以在 Docker 容器中运行时监控 Free Range Router (FRR) 功能。通常,FRR 作为服务运行。请注意,您必须重启 NetQ Agent 才能启用配置。
语法
netq config add agent frr-monitor
[<text-frr-docker-name>]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
NA | <text-frr-docker-name> | 收集具有此名称模式的 FRR Docker 容器的统计信息,供 grep 使用 |
使用示例
配置 NetQ Agent 以收集 FRR 统计信息
cumulus@switch:~$ netq config add agent frr-monitor frr
Successfully added FRR docker monitoring for netq-agent. Please restart service.
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config show agent frr-monitor
netq config del agent frr-monitor
netq config restart agent
netq config add agent gnmi-port
配置 gNMI Agent 监听的默认端口。有关更多信息,请参阅gNMI 流。
语法
netq config add agent gnmi-port <text-gnmi-port>
必需参数
参数 | 值 | 描述 |
---|---|---|
gnmi-port | <text-gnmi-port> | 配置 gNMI 以通过指定端口监听 |
选项
无
使用示例
cumulus@switch:~$ netq config add agent gnmi-port <gnmi_port>
相关命令
netq config add agent gnmi
netq config restart agent
netq config add agent loglevel
配置要记录的有关 NetQ Agent 活动的信息量,从仅关键问题到每个可用消息。已识别的问题将记录到 /var/log/netq-agent.log 文件中。默认日志级别为 info。
- Error:仅记录归类为错误的事件
- Warning:记录归类为警告和错误的事件
- Info:记录归类为信息、警告和错误的事件
- Debug:记录所有事件
完成调试后,将日志级别重置为 info 或更高。请注意,您必须重启 NetQ Agent 才能启用配置。
语法
netq config add agent loglevel
[debug|error|info|warning]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
NA | debug, error, info, warning | 记录具有此严重级别的 NetQ Agent 事件 |
使用示例
配置 NetQ Agent 以仅记录错误
cumulus@switch:~$ netq config add agent loglevel error
Successfully added logging for netq-agent. Please restart service.
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config show agent loglevel
netq config del agent loglevel
netq config restart agent
netq config add agent opta-discovery-servers
配置 IP 地址范围,以作为生命周期管理发现过程的一部分进行搜索(当 NetQ 查找未运行 NetQ 的 Cumulus Linux 交换机时)。
范围可以是连续的,例如 192.168.0.24-64,也可以是非连续的,例如 192.168.0.24-64,128-190,235,但它们必须在单个子网内。一个地址范围最多可以包含 50 个地址;如有必要,请将范围分解为较小的范围。
语法
netq config add agent opta-discovery-servers
<text-opta-discovery-ips>
[vrf <text-vrf-name>]
[port <text-discovery-server-port>]
必需参数
参数 | 值 | 描述 |
---|---|---|
opta-discovery-servers | <text-opta-discovery-ips> | 在此 IP 地址范围内查找未运行 NetQ 的 Cumulus Linux 交换机 |
选项
选项 | 值 | 描述 |
---|---|---|
vrf | <text-vrf-name> | 查找具有指定 IP 地址的 Cumulus Linux 交换机,这些交换机使用具有此名称的 VRF。如果未指定,该命令将使用default VRF。 |
port | <text-discovery-server-port> | 查找具有指定 IP 地址的 Cumulus Linux 交换机,这些交换机使用此端口。如果未指定,该命令将使用端口 31980。 |
使用示例
配置 IP 地址范围以搜索未运行 NetQ 的交换机
cumulus@switch:~$ netq config add agent opta-discovery-servers 192.168.0.24-64,128-190
Updated agent discovery servers 192.168.0.24-64,128-190 port 31980 vrf default. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config restart agent
netq config add agent opta-enable
启用或禁用 NetQ Agent。使用此命令使用 gNMI 收集数据。
语法
netq config add agent opta-enable [true|false]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
NA | true, false | 禁用 NetQ Agent (false) 或启用它 (true) |
相关命令
无
netq config add agent server
配置 NetQ Agent 收集的数据和 API 请求的目标 NetQ 服务器。
语法
netq config add agent server
<text-opta-ip>
[port <text-opta-port>]
[vrf <text-vrf-name>]
[ssl true | ssl false ]
[ssl-cert <text-ssl-cert-file> | ssl-cert download]
[inband-interface <interface-name>]
必需参数
参数 | 值 | 描述 |
---|---|---|
server | <text-opta-ip> | 使用具有此 IP 地址的 NetQ 服务器来接收 NetQ Agent 数据和 API 请求 |
选项
选项 | 值 | 描述 |
---|---|---|
port | <text-opta-port> | 使用 NetQ 服务器上的此端口来接收 NetQ Agent 数据和 API 请求 |
vrf | <text-vrf-name> | 使用 NetQ 服务器上的此 VRF 来接收 NetQ Agent 数据和 API 请求 |
ssl | true, false | 在 agent 和 OPTA 之间建立 SSL 连接 (true) |
ssl-cert | <text-ssl-cert-file> | 使用此文件中包含的 SSL 证书。值必须包含文件的完整路径。 |
ssl-cert download | NA | 下载 SSL 证书 |
inband-interface | 在不使用带外网络时,使用此带内接口来管理交换机 |
使用示例
配置具有默认端口和 VRF 的目标服务器
cumulus@switch:~$ netq config add agent server 192.168.200.250
Updated agent server 192.168.200.250 port 31980 vrf default. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config del agent server
netq config restart agent
netq config add agent services
配置 NetQ Agent 以监控 CPU 和内存使用率,以用于命令中指定的服务。您配置 agent 使用此命令监控的服务将添加到 UI 中显示的服务列表中。
此命令仅在 Spectrum 交换机上受支持。
语法
netq config add agent services <text-service-name-list>
必需参数
参数 | 值 | 描述 |
---|---|---|
services | <text-service-name-list> | 配置 NetQ Agent 以监控服务。将此值格式化为逗号分隔列表,不带空格。您最多可以添加 10 个服务。 |
选项
无
使用示例
cumulus@switch:~$ netq config add agent services dnsmasq
Successfully added services for netq-agent. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config show agent services
Services Enabled
----------------------------------------
dnsmasq
相关命令
netq config show agent services
netq config del agent services
netq config add agent spice
配置 NetQ Agent 以收集和发送 Spice 统计信息。此命令只能在运行 Cumulus Linux 的 Spectrum 交换机上运行。
语法
netq config add agent spice
必需参数
参数 | 值 | 描述 |
---|---|---|
spice | NA | 收集并发送 Spice 数据 |
选项
无
使用示例
cumulus@switch:~$ netq config add agent spice
Successfully added spice for netq-agent. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config del agent spice
netq conifg show agent spice
netq config add agent stats
配置 NetQ Agent 以收集和发送接口统计信息。
语法
netq config add agent stats
必需参数
参数 | 值 | 描述 |
---|---|---|
stats | NA | 收集并发送接口统计信息 |
选项
无
使用示例
cumulus@switch:~$ netq config add agent stats
stats config added. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config show agent stats
netq config del agent stats
netq config restart agent
netq config add agent wjh
配置 NetQ Agent 以从 NVIDIA Spectrum™ 交换机收集和发送“刚刚发生”事件。请参阅WJH 事件参考以获取支持的 WJH 事件列表,并参阅WJH 配置以获取配置信息。
语法
netq config add agent wjh
必需参数
参数 | 值 | 描述 |
---|---|---|
wjh | NA | 收集并发送“刚刚发生”事件 |
选项
无
使用示例
cumulus@chassis:~$ netq config add agent wjh
Successfully added WJH monitor. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
相关命令
netq config show agent wjh
netq config del agent wjh
netq config add agent wjh-drop-filter
netq config add agent wjh-threshold
netq config restart agent
netq config add agent wjh-drop-filter
在 NetQ 系统处理和显示 WJH 事件之前,在 NetQ Agent 处过滤这些事件。NetQ 基于丢弃类型执行过滤。您可以通过指定一个或多个丢弃原因、严重性或源/目标 IP 地址来进一步过滤丢弃类型。在使用 netq config restart agent
命令应用过滤器后,您必须重启 agent。
有关丢弃类型、原因和严重性的完整列表,请参阅WJH 事件参考。NVIDIA Spectrum 交换机仅支持 WJH 命令。
语法
netq config add agent wjh-drop-filter
drop-type <text-wjh-drop-type>
[drop-reasons <text-wjh-drop-reasons>]
[severity <text-drop-severity-list>]
netq config add agent wjh-drop-filter
ips [<text-wjh-ips>]
必需参数
参数 | 值 | 描述 |
---|---|---|
drop-type | <text-wjh-drop-type> | 忽略具有此丢弃类型的 WJH 事件。有效的丢弃类型包括 acl、buffer、l1、l2、router 和 tunnel。 |
选项
选项 | 值 | 描述 |
---|---|---|
drop-reasons | <text-wjh-drop-reasons> | 忽略具有这些丢弃原因的 WJH 事件。要指定多个丢弃原因,请将此值格式化为逗号分隔列表,不带空格。有效的丢弃原因因丢弃类型而异。请参阅WJH 事件参考。 |
severity | <text-drop-severity-list> | 忽略具有这些严重性的 WJH 事件。要指定多个严重性,请将此值格式化为逗号分隔列表,不带空格。有效的严重性包括 Notice、Warning 和 Error。 |
ips | <text-wjh-drop-ips> | 忽略这些 IP 地址的 WJH 事件。将此值格式化为逗号分隔列表。 |
使用示例
以下示例配置 NetQ Agent 以忽略所有 L1 丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter drop-type l1
此示例配置 NetQ Agent 以忽略具有不良信号完整性的 L1 丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter drop-type l1 drop-reasons BAD_SIGNAL_INTEGRITY
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
此示例配置 NetQ Agent 以忽略严重级别为“warning”的路由器丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter drop-type router severity Warning
此示例配置 NetQ Agent 以忽略由于黑洞路由导致的路由器丢弃
cumulus@netq-ts:~$ sudo netq config add agent wjh-drop-filter drop-type router drop-reasons BLACKHOLE_ROUTE
以下示例配置 NetQ Agent 以忽略包含 192.168.0.15 作为源或目标 IP 地址的所有丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter ips 192.168.0.15
此示例配置 NetQ Agent 以忽略包含 192.168.0.15 或 192.168.0.45 作为源或目标 IP 地址的所有丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter ips 192.168.0.15,192.168.0.45
此示例配置 NetQ Agent 以忽略包含 192.168.0.15/16 前缀网络作为源或目标 IP 地址的所有丢弃
cumulus@switch:~$ sudo netq config add agent wjh-drop-filter ips 192.168.0.15/16
相关命令
netq config del agent wjh-drop-filter
netq config add agent wjh
netq config add agent wjh-threshold
netq config show agent wjh-drop-filter
netq config add agent wjh-threshold
WJH 延迟和拥塞指标取决于阈值设置以触发事件。NetQ 将数据包延迟测量为在单个系统(交换机)内花费的时间。它将拥塞测量为交换机上缓冲区占用率的百分比。配置后,当指标超过高阈值和低阈值时,NetQ Agent 会收集并发送这些 WJH 触发的事件。
此命令仅适用于 NVIDIA Spectrum 交换机。
语法
netq config add agent wjh-threshold
(latency|congestion)
(<text-tc-list>|all)
(<text-port-list>|all)
<text-th-hi>
<text-th-lo>
必需参数
参数 | 值 | 描述 |
---|---|---|
wjh-threshold | NA | 收集并发送由指定的高阈值和低阈值触发的 WJH 延迟或拥塞事件 |
latency | NA | 收集并发送 WJH 延迟事件 |
congestion | NA | 收集并发送 WJH 拥塞事件 |
NA | <text-tc-list> 或 all | 仅发送这些流量类别的事件,或对所有流量类别使用 all。要包含多个流量类别,请将此值格式化为逗号分隔列表,不带空格。 |
NA | <text-port-list> 或 all | 仅发送在这些端口上发生的事件,或对所有端口使用 all。要包含多个端口,请将此值格式化为逗号分隔列表,不带空格。例如 swp1,swp2,swp3,swp4。 |
NA | <text-th-hi> | 当延迟大于此时间量,或缓冲区占用率大于此百分比时,触发事件。 |
NA | <text-th-lo> | 当延迟小于此时间量,或缓冲区占用率小于此百分比时,触发事件。 |
选项
无
使用示例
为端口 swp1 上 3 类流量创建延迟阈值,其中上限阈值为 10,下限阈值为 1。
cumulus@switch:~$ sudo netq config add agent wjh-threshold latency 3 swp1 10 1
为端口 swp1 上 4 类流量创建拥塞阈值,其中上限阈值为 200,下限阈值为 10。
cumulus@switch:~$ sudo netq config add agent wjh-threshold congestion 4 swp1 200 10
相关命令
netq config show agent wjh-threshold
netq config del agent wjh-threshold
netq config add agent wjh
netq config add agent wjh-drop-filter
netq config restart agent
netq config add cli proxy
向 CLI 配置添加新的代理服务器。
语法
netq config add cli proxy
<text-proxy-type>
<text-proxy-url>
必需参数
参数 | 值 | 描述 |
---|---|---|
NA | <text-proxy-type> | 代理类型 (http, https) |
NA | <text-proxy-url> | 代理服务器 URL |
选项
无
相关命令
netq config del cli proxy
netq config add cli server
在运行此命令的交换机或主机上配置 NetQ CLI。云部署需要 access-key
和 secret-key
选项或 cli-keys-file
选项,以及 premises
选项。
如果未配置 NetQ CLI,您只能运行 netq config
和 netq help
命令,并且必须使用 sudo
才能运行它们。
语法
netq config add cli server
<text-gateway-dest>
[access-key <text-access-key> secret-key <text-secret-key> premises <text-premises-name> | cli-keys-file <text-key-file> premises <text-premises-name>]
[vrf <text-vrf-name>]
[port <text-gateway-port>]
必需参数
参数 | 值 | 描述 |
---|---|---|
server | <text-gateway-dest> | 本地部署中 NetQ 设备或 VM 的主机名或 IP 地址,或云/远程部署的网关 IP 地址或域名。 |
access-key | <text-access-key> | 从 NetQ UI 获取的用于云/远程部署的访问密钥 |
secret-key | <text-secret-key> | 从 NetQ UI 获取的用于云/远程部署的密钥 |
premises | <text-premises-name> | 具有要监控的数据的场所名称。当您有多个场所时,您必须再次运行此命令才能查看来自另一个场所的数据。 |
cli-keys-file | <text-key-file> | 对于云/远程部署,请使用此文件中包含的访问密钥和密钥,而不是单独提供密钥。值必须包含文件的完整路径。 |
选项
参数 | 值 | 描述 |
---|---|---|
vrf | <text-vrf-name> | 使用此 VRF 与遥测服务器(NetQ 设备、VM 或云网关)进行通信。这应与您设置路由表以连接到遥测服务器的 VRF 相同。通常这是管理 VRF。 |
port | <text-gateway-port> | 使用此端口与遥测服务器(NetQ 设备、VM 或云网关)进行通信。本地部署的默认端口为 32708,云部署的默认端口为 443。 |
使用示例
本地
cumulus@switch:~$ sudo netq config add cli server 10.0.1.1 vrf mgmt port 32000
cumulus@switch:~$ sudo netq config restart cli
云/远程
cumulus@switch:~# sudo netq config add cli server api.netq.cumulusnetworks.com access-key 45d11f46bc09986db64612c590204054b1f12bc05219324a7d66084cf741779c secret-key zHoQ9feNlScNuGBVzUNqr0c0kJL+FAZbhEz8YtW2Rc0= premises NewYork
cumulus@switch:~# sudo netq config restart cli
相关命令
netq config show cli premises
netq config del cli server
netq config restart cli
netq config asic-monitor-simulation
语法
netq config (start|stop|status|restart) asic-monitor-simulation
必需参数
参数 | 值 | 描述 |
---|---|---|
config | start, stop, status, restart | NA |
选项
无
相关命令
无
netq config color
配置命令输出以彩色显示许多命令的结果。有错误的结果以 红色 显示,警告以 黄色 显示。没有错误或警告的结果以黑色或 绿色 显示。VTEP 以 蓝色 显示。trace 命令的 pretty 输出中的节点以 粗体 显示,路由器接口用角括号 (< >) 包裹。输出在您运行命令后立即以颜色提示显示。
语法
netq config (add|del) color
必需参数
参数 | 值 | 描述 |
---|---|---|
add | NA | 显示彩色编码的命令输出 |
del | NA | 移除彩色编码的命令输出 |
选项
无
使用示例
cumulus@switch:~$ netq config add color
Color coded output config added
相关命令
无
netq config agent factory-reset commands
重置 NetQ Agent 模块化命令的工厂默认设置,移除对要收集的数据和轮询频率所做的任何手动调整。
语法
netq config agent factory-reset commands
必需参数
参数 | 值 | 描述 |
---|---|---|
factory-reset commands | NA | 将 NetQ Agent 轮询数据和频率重置为出厂设置 |
选项
无
使用示例
cumulus@switch:~$ netq config agent factory-reset commands
Netq Command factory reset successful
相关命令
netq config add agent
netq config show agent
netq config del agent
禁用或移除交换机上的 NetQ Agent 配置。
语法
netq config del agent
[asic-monitor|cluster-servers|cpu-limit|frr-monitor|loglevel|server|spice|ssl|stats|wjh]
[json]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
asic-monitor | NA | 停止 NetQ Agent 监控 ASIC |
cluster-servers | NA | 移除配置为接收 NetQ Agent 数据的所有集群服务器 |
cpu-limit | NA | 移除此设备上 NetQ Agent 的 CPU 使用率限制 |
frr-monitor | NA | 停止 NetQ Agent 监控在容器中运行时的 FRR |
loglevel | NA | 停止 NetQ Agent 记录有关 agent 的事件 |
server | NA | 删除 NetQ Agent 数据和 API 请求的当前目标 |
spice | NA | 停止 NetQ Agent 收集 Spice 数据 |
ssl | NA | 删除 SSL 配置 |
stats | NA | 停止 NetQ Agent 收集接口统计信息 |
wjh | NA | 停止 NetQ Agent 收集 WJH 信息 |
json | NA | 以 JSON 文件格式显示输出 |
使用示例
cumulus@switch:~$ netq config del agent cluster-servers
Deleted agent cluster servers 10.10.0.101,10.20.0.101 port 31980 vrf default. Please restart netq-agent (netq config restart agent)
cumulus@switch:~$ netq config restart agent
相关命令
netq config add agent
netq config restart agent
netq config show agent
netq config del agent services
配置 NetQ Agent 以停止监控 CPU 和内存使用率,以用于命令中指定的服务。您配置 agent 使用此命令监控的服务将从 UI 中显示的服务列表中移除。以下服务始终受到监控,无法删除:monclagd、mstpd、lldpd、frr(包括 zebra、bgpd、ospfd)、netqd、netq-agent、wd_keepalive、nvued、switchd、sx_sdk、ntpd、pwmd 和 smond。
此命令仅在 Spectrum 交换机上受支持。
语法
netq config del agent services <text-service-name-list>
必需参数
参数 | 值 | 描述 |
---|---|---|
services | <text-service-name-list> | 停止 NetQ Agent 监控指定的服务。将此值格式化为逗号分隔列表,不带空格。 |
选项
无
相关命令
netq config show agent services
netq config add agent services
netq config del agent wjh-drop-filter
删除交换机上的“刚刚发生”事件过滤器。运行 netq show agent wjh-drop-filter
命令以获取 WJH 过滤器配置列表。
语法
netq config del agent wjh-drop-filter
drop-type <text-wjh-drop-type>
[drop-reasons <text-wjh-drop-reasons>]
[severity <text-drop-severity-list>]
netq config del agent wjh-drop-filter
ips [<text-wjh-ips>]
必需参数
参数 | 值 | 描述 |
---|---|---|
drop-type | <text-wjh-drop-type> | 删除具有此丢弃类型的 WJH 事件过滤器。有效的丢弃类型包括 acl、buffer、l1、l2、router 和 tunnel。 |
选项
选项 | 值 | 描述 |
---|---|---|
drop-reasons | <text-wjh-drop-reasons> | 删除具有这些丢弃原因的 WJH 事件过滤器。要指定多个丢弃原因,请将此值格式化为逗号分隔列表,不带空格。有效的丢弃原因因丢弃类型而异。请参阅WJH 事件参考。 |
severity | <text-drop-severity-list> | 删除具有这些严重性的 WJH 事件过滤器。要指定多个严重性,请将此值格式化为逗号分隔列表,不带空格。有效的严重性包括 Notice、Warning 和 Error。 |
ips | <text-wjh-drop-type> | 删除这些 IP 地址的 WJH 事件过滤器(逗号分隔列表) |
使用示例
移除指定丢弃原因的 L1 过滤器
cumulus@switch:~$ sudo netq config del agent wjh-drop-filter drop-type l1 drop-reasons PORT_ADMIN_DOWN,BAD_SIGNAL_INTEGRITY
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
移除所有基于 IP 的 WJH 过滤器
cumulus@switch:~$ sudo netq config del agent wjh-drop-filter ips
移除源或目标 IP 地址为 192.168.0.15 或 192.168.0.45 的 WJH 过滤器
cumulus@switch:~$ sudo netq config del agent wjh-drop-filter ips 192.168.0.15,192.168.0.45
相关命令
netq config add agent wjh-drop-filter
netq config add/del agent wjh
netq config del agent wjh-threshold
netq config show agent wjh-drop-filter
netq config del agent wjh-threshold
移除 WJH 事件的延迟或拥塞阈值。
语法
netq config del agent wjh-threshold
(latency|congestion)
(<text-tc-list>|all)
必需参数
参数 | 值 | 描述 |
---|---|---|
wjh-threshold | NA | 移除由阈值触发的延迟或拥塞事件 |
latency | NA | 移除延迟事件阈值 |
congestion | NA | 移除拥塞事件阈值 |
NA | <text-tc-list> 或 all | 移除这些流量类别的延迟或拥塞事件,或对所有流量类别使用 all。当您需要多个流量类别时,请将此值格式化为逗号分隔列表,不带空格。 |
选项
无
使用示例
cumulus@switch:~$ netq config del agent wjh-threshold latency 3
cumulus@switch:~$ netq config del agent wjh-threshold congestion 4
相关命令
netq config show agent wjh-threshold
netq config add agent wjh-threshold
netq config del agent wjh
netq config del agent wjh-drop-filter
netq config restart agent
netq config del cli
从交换机中移除 NetQ CLI 配置或代理服务器。
语法
netq config del cli (server | proxy)
必需参数
参数 | 值 | 描述 |
---|---|---|
cli | server, proxy | 删除当前的 NetQ CLI 配置或代理服务器 |
选项
无
使用示例
cumulus@switch:~$ netq config del cli server
相关命令
netq config add cli server
netq config show cli premises
netq config restart agent
netq config reload parser
加载 NetQ 配置文件。
语法
netq config reload parser
必需参数
无
选项
无
使用示例
cumulus@switch:~$ netq config reload parser
Parser reloaded
相关命令
无
netq config reset premise
重置给定场所的 UUID。在云部署中,此命令可用于重置场所,以便可以重新配置该场所并将其附加到不同的 VM。
语法
netq config reset premise <test-premises-name>
必需参数
参数 | 值 | 描述 |
---|---|---|
premise | <text-premises-name> | 重置具有此名称的场所 |
选项
无
使用示例
使用 netq config show cli premises
命令检查场所是否处于活动状态或非活动状态。状态必须为非活动状态,然后才能将其附加到新服务器。
cumulus@switch:~$ netq config show cli premises
Name OPID Timezone Namespace Tag CLI Status Status
----------------- ---------- ---------- ----------- ----- ------------ --------
prem-1 1719853531 PST default US not selected Active
prem-2 1719855240 PST default US selected Inactive
cumulus@switch:~$ netq config reset premise prem-1
Premise has been reset successfully. Please verify using 'netq config show cli premises'
cumulus@switch:~$ netq config show cli premises
Name OPID Timezone Namespace Tag CLI Status Status
----------------- ---------- ---------- ----------- ----- ------------ --------
prem-1 1719853531 PST default US not selected Inactive
prem-2 1719855240 PST default US selected Inactive
相关命令
netq config show cli premises
netq config restart
重启交换机上的 NetQ Agent 或 CLI 守护程序。在更改 NetQ Agent 或 CLI 配置后使用此命令。
语法
netq config restart agent
netq config restart cli
必需参数
参数 | 值 | 描述 |
---|---|---|
agent | NA | 重启 NetQ Agent 守护程序 (netq-agent ) |
cli | NA | 重启 NetQ CLI 守护程序 (netq-cli ) |
选项
无
使用示例
cumulus@switch:~$ netq config restart agent
Restarting netq-agent... Success!
cumulus@switch:~$ netq config restart cli
Restarting NetQ CLI... Success!
相关命令
netq config stop agent
netq config status agent
netq config select cli premise
在多场所部署中,此命令配置 NetQ CLI 以查看来自给定场所的数据。
语法
netq config select cli
premise <text-premise>
必需参数
参数 | 值 | 描述 |
---|---|---|
premise | <text-premise> | 在 NetQ CLI 命令输出中显示来自此场所的数据 |
选项
无
使用示例
cumulus@switch:~$ netq config select cli premise Boston
Input premise Boston
Switched to premise Boston
相关命令
netq config show cli premises
netq config show agent
显示交换机上 NetQ Agent 的配置。此命令有多种形式可用。
语法
netq config show agent
[asic-monitor|cpu-limit|frr-monitor|loglevel|services|ssl|stats|wjh|wjh-drop-filter|wjh-threshold]
[json]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
asic-monitor | NA | 显示 NetQ Agent ASIC 监控配置 |
cpu-limit | NA | 查看 NetQ Agent 可以使用的 CPU 资源最大百分比 |
frr-monitor | NA | 显示 FRR 监控配置 |
loglevel | NA | 显示 NetQ Agent 日志级别配置 |
services | NA | 显示自定义服务和进程配置 |
ssl | NA | 显示 SSL 配置 |
stats | NA | 显示接口统计信息的状态 |
wjh | NA | 显示 NetQ Agent “刚刚发生”监控配置 |
wjh-drop-filter | NA | 显示 NetQ Agent WJH 过滤器配置 |
wjh-threshold | NA | 显示 NetQ Agent WJH 延迟和拥塞阈值配置 |
json | NA | 以 JSON 格式显示输出 |
使用示例
cumulus@switch:~$ netq config show agent
netq-agent value default
------------------------ --------- ---------
exhibitport
exhibiturl
server 127.0.0.1 127.0.0.1
cpu-limit 100 100
agenturl
wjh Enabled
enable-opta-discovery False False
agentport 8981 8981
port 31980 31980
vrf default default
is-gnmi-enabled False False
netq_stream_port 7680 7680
netq_stream_address 127.0.0.1 127.0.0.1
is-ssl-enabled False False
ssl-cert
generate-unique-hostname False False
()
相关命令
netq config show all
netq config show cli premises
netq config add agent
netq config del agent
netq config show agent commands
NetQ Agent 包含一组预配置的模块化命令,这些命令定期运行并将事件和资源数据发送到 NetQ 设备或 VM。此命令显示这些命令的配置,包括命令的定义、哪些命令处于活动状态以及它们的运行频率。您还可以按服务密钥进行过滤以查看给定命令。
语法
netq config show agent commands
[service-key <text-service-key-anchor>]
[json]
必需参数
参数 | 值 | 描述 |
---|---|---|
commands | NA | 查看所有 NetQ Agent 模块化命令的配置 |
选项
选项 | 值 | 描述 |
---|---|---|
service-key | <text-service-key-anchor> | 查看具有此服务密钥(名称)的 NetQ Agent 命令的配置 |
json | NA | 以 JSON 格式显示输出 |
使用示例
显示所有命令的配置
cumulus@switch:~$ sudo netq config show agent commands
Service Key Period Active Command Timeout
----------------------- -------- -------- -------------------------------------------------------------- ---------
bgp-neighbors 60 yes ['/usr/bin/vtysh', '-c', 'show ip bgp vrf all neighbors json'] 30
evpn-vni 60 yes ['/usr/bin/vtysh', '-c', 'show bgp l2vpn evpn vni json'] 30
lldp-json 120 yes /usr/sbin/lldpctl -f json 30
clagctl-json 60 yes /usr/bin/clagctl -j 30
mstpctl-bridge-json 60 yes /sbin/mstpctl showall json 30
ports 3600 yes Netq Predefined Command 30
proc-net-dev 30 yes Netq Predefined Command 30
dom 1800 yes Netq Predefined Command 30
roce 60 yes Netq Predefined Command 30
roce-config 300 yes Netq Predefined Command 30
nvue-roce-config 300 yes Netq Predefined Command 30
ntp 30 yes Netq Predefined Command 45
agent_stats 300 yes Netq Predefined Command 30
agent_util_stats 300 yes Netq Predefined Command 30
tcam-resource-json 300 yes /usr/cumulus/bin/cl-resource-query -j 30
nvue-mon-json 300 yes Netq Predefined Command 30
cl-support-json 3600 yes Netq Predefined Command 30
resource-util-json 300 yes findmnt / -n -o FS-OPTIONS 30
smonctl-json 120 yes /usr/sbin/smonctl -j 30
sensors-json 1800 yes sensors -u 30
ssd-util-json 86400 yes /usr/sbin/smartctl -a /dev/sda 30
ssd-util-nvme-json 86400 yes /usr/sbin/smartctl -a /dev/nvme0 30
ecmp-hash-info 300 yes cat /etc/cumulus/datapath/traffic.conf 30
ecmp-info 60 yes Netq Predefined Command 30
ptp-config-info 60 yes cat /etc/ptp4l.conf 30
ptp-clock-info 60 yes Netq Predefined Command 30
ptp-clock-status 60 yes Netq Predefined Command 30
ptp-statistics 60 yes Netq Predefined Command 30
ptp-correction 30 yes Netq Predefined Command 30
log-exporter 60 yes Netq Predefined Command 30
adaptive-routing-config 300 yes Netq Predefined Command 30
ber-info 30 yes Netq Predefined Command 30
显示指定命令的配置
cumulus@switch:~$ netq config show agent commands service-key agent_stats
Service Key Period Active Command
--------------- -------- -------- -----------------------
agent_stats 300 yes Netq Predefined Command
相关命令
netq config add agent commands
netq config agent factory-reset commands
netq config show all
显示交换机上 NetQ Agent 和 NetQ CLI 的配置。
语法
netq config show all
[json]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
json | NA | 以 JSON 格式显示输出 |
使用示例
cumulus@switch:~$ netq config show all
netq-agent value default
------------------------ --------- ---------
exhibitport
exhibiturl
server 127.0.0.1 127.0.0.1
cpu-limit 100 100
agenturl
wjh Enabled Enabled
enable-opta-discovery False False
agentport 8981 8981
port 31980 31980
vrf default default
is-gnmi-enabled False False
netq_stream_port 7680 7680
netq_stream_address 127.0.0.1 127.0.0.1
is-ssl-enabled False False
ssl-cert
generate-unique-hostname False False
agent-hostname cumulus cumulus
()
netq-cli value default
----------- ------------- ---------
server 10.188.46.182 127.0.0.1
netq-user admin
premises OPID0
port 32708 32708
count 4000 4000
vrf default default
api-logging False False
()
相关命令
netq config show agent
netq config show cli premises
netq config show cli premises
显示跨场所的 NetQ CLI 的配置。
语法
netq config show cli premises
[json]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
json | NA | 以 JSON 格式显示输出 |
使用示例
cumulus@switch:~$ netq config show cli premises
Name OPID Timezone Namespace Tag CLI Status Status
--------------- ---------- ---------- ----------- ----- ------------ -----------
OPID0 0 IST nan TAG0 selected Active
premise1 20001 PST nan US not selected Inactive
premise2 20002 PST nan US not selected Inactive
()
相关命令
netq config select cli premise
netq config reset premise
netq config start agent
启动交换机上的 NetQ Agent。
语法
netq config start agent
必需参数
无
选项
无
使用示例
cumulus@switch:~$ netq config start agent
Starting netq-agent... Success!
相关命令
netq config show agent
netq config stop agent
netq config restart agent
netq config status agent
显示交换机上 NetQ Agent 的运行状态。
语法
netq config status agent
[verbose]
[json]
必需参数
无
选项
选项 | 值 | 描述 |
---|---|---|
verbose | NA | 显示详细输出 |
json | NA | 以 JSON 格式显示输出 |
使用示例
cumulus@switch:~$ netq config status agent
netq-agent... Running
cumulus@switch:~$ netq config status agent
netq-agent...stopped
相关命令
netq config show agent
netq config stop agent
netq config restart agent
netq config status cli
显示交换机上 NetQ CLI 的运行状态。
语法
netq config status cli
必需参数
无
选项
无
使用示例
cumulus@switch:~$ netq config status cli
NetQ CLI... Running
相关命令
netq config show cli premises
netq config restart cli
netq config stop agent
停止交换机上的 NetQ Agent。
语法
netq config stop agent
必需参数
无
选项
无
使用示例
cumulus@switch:~$ netq config stop agent
Stopping netq-agent... Success!
相关命令
netq config show agent
netq config start agent
netq config restart agent