IOS Exec Commands
Options
| Option | Description | Default |
|---|---|---|
|
Target device IP/hostname |
|
|
Output format: |
|
|
Command timeout in seconds |
30 |
Examples
802.1X/MAB Troubleshooting
# List all access sessions
netapi ios exec "show access-session"
# Specific interface detail
netapi ios exec "show access-session interface GigabitEthernet4/0/11 detail"
# Check authentication method status
netapi ios exec "show authentication sessions"
Sample Output: access-session detail
Interface: GigabitEthernet4/0/11
MAC Address: 00:50:C2:39:F0:F7
IPv4 Address: 10.238.1.28
User-Name: 00-50-C2-39-F0-F7
Status: Authorized
Domain: DATA
Oper host mode: multi-auth
Oper control dir: both
Session timeout: N/A
Common Session ID: 0AC190E400000E1B8A5D3C7F
Acct Session ID: 0x00000FA2
Handle: 0x7C00001D
Current Policy: POLICY_Gi4/0/11
Server Policies:
Vlan Group: Vlan: 751
ACS ACL: xACSACLx-IP-TEST_Medical_Temp_Monitor-697290bb
Method status list:
Method State
dot1x Stopped
mab Authc Success
CI/CD Integration
- name: Validate 802.1X sessions
run: |
sessions=$(netapi ios exec "show access-session" --format json)
unauthorized=$(echo "$sessions" | jq '[.[] | select(.status != "Authorized")] | length')
if [ "$unauthorized" -gt 0 ]; then
echo "::warning::$unauthorized unauthorized sessions detected"
fi