Skip to main content
Mole listing peers

muti-metroo peers

List all agents currently connected to this agent.

# List peers on local agent
muti-metroo peers

# List peers on remote agent
muti-metroo peers -a 192.168.1.10:8080

# JSON output for scripting
muti-metroo peers --json

Usage

muti-metroo peers [flags]

Flags

FlagShortDefaultDescription
--agent-alocalhost:8080Agent HTTP API address
--jsonfalseOutput in JSON format

Example Output

Connected Peers
===============
ID NAME STATE ROLE RTT
-- ---- ----- ---- ---
abc123def456 Agent-B connected dialer 23ms
789xyz012345 Agent-C connected listener 15ms

Total: 2 peer(s)

Output Fields

FieldDescription
IDShort agent ID (first 12 characters)
NAMEAgent display name
STATEConnection state (connected or UNRESPONSIVE in red)
ROLEdialer (this agent initiated) or listener (peer initiated)
RTTRound-trip time in milliseconds (- if not measured)

JSON Output

muti-metroo peers --json
[
{
"id": "abc123def456789012345678901234ab",
"short_id": "abc123def456",
"display_name": "Agent-B",
"state": "connected",
"rtt_ms": 23,
"unresponsive": false,
"is_dialer": true
},
{
"id": "789xyz012345678901234567890123cd",
"short_id": "789xyz012345",
"display_name": "Agent-C",
"state": "connected",
"rtt_ms": 15,
"unresponsive": false,
"is_dialer": false
}
]

Understanding Roles

  • dialer: This agent initiated the connection to the peer
  • listener: The peer initiated the connection to this agent

Both roles are functionally equivalent once connected - traffic flows bidirectionally regardless of who initiated.

Unresponsive Peers

Peers marked as UNRESPONSIVE (shown in red) have not responded to keepalive messages within the timeout period. This may indicate:

  • Network connectivity issues
  • The peer agent is overloaded
  • The peer agent has crashed

Unresponsive peers will be automatically disconnected after the connection timeout.

Use Cases

Check Mesh Connectivity

# Verify all expected peers are connected
muti-metroo peers

Scripted Peer Count Check

# Alert if peer count drops below threshold
PEER_COUNT=$(muti-metroo peers --json | jq 'length')
if [ "$PEER_COUNT" -lt 2 ]; then
echo "Warning: Only $PEER_COUNT peers connected"
fi