Cables Agent
The Cables agent is implemented as a docker container that executes on the switch to gather data on neighboring switches and link quality. The agent operates a web service capable of providing information on ports and links through user queries. Moreover, the agent transmits validation reports to the bringup server.
Check if cable agent is running on the switch:
Run:
ssh admin@<
switch
-ip-or-name>Enable
Show docker images
Exit
If cables agent is running on the switch, the following output is prompted.
----------------------------------------------------------------------------
Image Version Created Size
----------------------------------------------------------------------------
cables_agent latest 13
hours ago 788MB
Usually, it is not necessary to manually deploy the agent onto the switch, as it is recommended to use the deploy_all_agents or deploy_single_agent commands from the bringup CLI. However, in instances where manual deployment is required, the following commands can be executed:
enable
configure terminal
no docker shutdown
image fetch scp://<user>:<pwd>@<hostname>/tmp/cables_agent_<version>.tar.gz cables_agent_latest.tar.gz
docker load cables_agent_latest.tar.gz
docker start cables_agent latest cables_agent now-and-init privileged network
For cleanup, run:
docker no start cables_agent
docker remove image cables_agent latest
image delete cables_agent_latest.tar.gz
To enter terminal in the container running on the switch, run:
enable
configure terminal
docker exec cables_agent /bin/bash
The agent has a web server listening on port 8251. The following two REST APIs are supported:
https://<switch-ip-or-name>:8251/resources/links
https://<switch-ip-or-name>:8251/resources/ports
Links Output Example
curl -k https://sw-hdr-proton01:8251/resources/links | python3 -m json.tool
[
{
"info"
: {
"md5"
: "256477d766fa8d8853848c43c35982ba"
,
"timestamp"
: 1659355401394591
,
"time"
: "2022-08-01 12:03:21.394601"
},
"src"
: {
"Node Description"
: "MF0;sw-hdr-proton01:MQM8700/U1"
,
"Guid"
: "0x0c42a1030079a6ec"
,
"ip"
: "10.209.44.74"
,
"Node Name"
: "sw-hdr-proton01"
},
"dests"
: {
"4"
: {
"Node Description"
: "swx-proton04 mlx5_2"
,
"Guid"
: "0xb8cef6030083bea2"
,
"LocalPort"
: "1"
},
"2"
: {
"Node Description"
: "Quantum Mellanox Technologies"
,
"Guid"
: "0xb8cef60300fbf210"
,
"LocalPort"
: "2"
},
"3"
: {
"Node Description"
: "swx-proton03 mlx5_0"
,
"Guid"
: "0xb8cef6030083bf02"
,
"LocalPort"
: "1"
},
"1"
: {
"Node Description"
: "Quantum Mellanox Technologies"
,
"Guid"
: "0xb8cef60300fbf210"
,
"LocalPort"
: "1"
}
}
}
]
Output Example of Ports
curl -k https://sw-hdr-proton01:8251/resources/ports | python3 -m json.tool
[
{
"port"
: "IB1/10"
,
"port_num"
: "10"
,
"logical"
: "Down"
,
"physical"
: "Polling"
},
{
"port"
: "IB1/11"
,
"port_num"
: "11"
,
"logical"
: "Down"
,
"physical"
: "Polling"
},
{
"port"
: "IB1/12"
,
"port_num"
: "12"
,
"logical"
: "Down"
,
"physical"
: "Polling"
},
{
"port"
: "IB1/13"
,
"port_num"
: "13"
,
"logical"
: "Down"
,
"physical"
: "Polling"
}
]