PluginBench
Skill
Pass
Audit score 90

network-interface-health

affaan-m/ecc

Diagnose physical link, duplex, and congestion issues by analyzing interface error and drop counters on routers, switches, and Linux hosts.

What is network-interface-health?

Captures and compares network interface counters (CRCs, drops, errors, flaps) across measurement intervals to identify cable, transceiver, duplex mismatch, or congestion problems. Use this when a host or link shows packet loss, latency spikes, or intermittent reachability.

  • Baseline and trend interface error counters (CRCs, input/output errors, drops, resets) on both ends of a link
  • Diagnose duplex mismatches, speed negotiation failures, and flapping events from counter increments and logs
  • Distinguish input drops (signal/hardware issues) from output drops (congestion/QoS)
  • Parse `show interfaces` output on routers/switches and `ip -s link` / `ethtool` on Linux hosts
  • Reference counter meanings and common causes (bad cable, dirty fiber, MTU mismatch, queue pressure)
  • Provide safe regex-based parsing to avoid misaligning counters across large interface blocks

How to install network-interface-health

npx skills add null --skill network-interface-health
Claude Code
Cursor
Windsurf
Cline

How to use network-interface-health

  1. 1.Capture baseline interface counters using `show interfaces <interface>` (Cisco/Arista) or `ip -s link show <interface>` (Linux)
  2. 2.Wait a measurement interval (typically 5–15 minutes) to allow errors or drops to accumulate if the problem is active
  3. 3.Capture counters again and calculate the increment (new value minus baseline) for each counter
  4. 4.Check both ends of the suspected link and compare receive-side errors on one port with transmit-side behavior on the other
  5. 5.Review logs for flap events, resets, or state changes around the same timestamp using `show logging | include <interface>`
  6. 6.If CRCs or input errors are incrementing, replace the cable or optic; if duplex mismatch is suspected, verify speed/duplex settings match on both sides
  7. 7.If drops are incrementing, measure interface utilization and check QoS policy before assuming a hardware problem

Use cases

Good for
  • A VLAN or host has packet loss or intermittent reachability; compare interface counters on both link ends to rule out cable or transceiver failure before replacing hardware.
  • Switch port shows rising CRC or input error counts; capture baseline, wait, re-capture, and compare increments to confirm active problem vs. historical counter.
  • Internet throughput is slow but LAN is fine; check WAN interface drops and uplink utilization to isolate congestion from physical link issues.
  • Change window requires before/after interface counter evidence; baseline counters, apply changes, then re-capture to prove link stability.
  • Duplex or speed mismatch suspected; verify both sides match and prefer auto-negotiation; if fixed speed/duplex is required, configure both sides explicitly.
Who it's for
  • Network engineers and operators troubleshooting intermittent reachability or packet loss
  • System administrators diagnosing host-to-switch link quality on Linux servers
  • Change-control teams needing counter-based evidence of link stability before and after configuration changes
  • Support teams investigating customer reports of slow or flaky connectivity

network-interface-health FAQ

What is the difference between input drops and output drops?

Input drops occur when the interface cannot accept inbound packets (burst, oversubscription, or CPU path saturation). Output drops occur when the egress queue discards packets due to congestion or QoS policy. Input drops usually point to a signal or hardware issue on the receiving side; output drops usually indicate congestion or an undersized uplink.

Should I clear interface counters before diagnosing?

No. Always save the baseline counters first. Clearing counters before recording a baseline loses historical evidence and makes it harder to confirm whether an error is active or residual. Clear counters only after documenting the baseline and confirming the problem is resolved.

How do I know if a CRC error is a current problem or old history?

Capture counters, wait a measurement interval (5–15 minutes), then capture again. If the CRC counter increments during that interval, the problem is active. If it stays the same, the CRCs are historical and may not be the cause of current symptoms.

What should I check if both ends of a link show no errors but the link still flaps?

Check logs for flap events, resets, or keepalive timeouts around the same timestamp. Verify speed/duplex settings match on both sides and prefer auto-negotiation. Inspect the cable and optics for physical damage, and check driver or firmware versions on the interface hardware.

Can I assume output drops mean a bad cable?

No. Output drops usually indicate congestion, QoS policy, or an undersized uplink, not a cable problem. First measure interface utilization and check QoS counters. Only investigate the cable if input errors or CRCs are also incrementing on the same interface.

Full instructions (SKILL.md)

Source of truth, from affaan-m/ecc.


name: network-interface-health description: Diagnose interface errors, drops, CRCs, duplex mismatches, flapping, speed negotiation issues, and counter trends on routers, switches, and Linux hosts. metadata: origin: community

Network Interface Health

Use this skill when a network symptom might be caused by a physical link, switch port, cable, transceiver, duplex setting, or congested interface.

When to Use

  • A host or VLAN has packet loss, latency spikes, or intermittent reachability.
  • A switch or router interface shows CRCs, runts, giants, drops, resets, or flaps.
  • You need to compare both ends of a link before replacing hardware.
  • A change window needs before/after interface counter evidence.
  • Monitoring reports rising ifInErrors, ifOutErrors, or ifOutDiscards.

How It Works

Interface counters are evidence, but the trend matters more than the absolute number. Capture a baseline, wait a measurement interval, capture again, then compare increments.

show interfaces <interface>
show interfaces <interface> status
show logging | include <interface>|changed state|line protocol

On Linux hosts:

ip -s link show <interface>
ethtool <interface>
ethtool -S <interface>

Counter Reference

CounterMeaningCommon cause
CRCReceived frame checksum failedBad cable, dirty fiber, bad optic, duplex mismatch
input errorsAggregate receive-side errorsCheck sub-counters before concluding
runtsFrames below minimum Ethernet sizeDuplex mismatch, collision domain, faulty NIC
giantsFrames larger than expected MTUMTU mismatch or jumbo-frame boundary
input dropsDevice could not accept inbound packetsBurst, oversubscription, CPU path, queue pressure
output dropsEgress queue discarded packetsCongestion, QoS policy, undersized uplink
resetsInterface hardware resetFlapping, keepalive, driver, optic, power
collisionsEthernet collision counterHalf duplex or negotiation mismatch

Diagnosis Flow

CRCs Or Input Errors

  1. Confirm counters are incrementing, not just historical.
  2. Check both ends of the link. Receive-side errors usually point to the signal arriving on that side, not necessarily the port reporting the error.
  3. Replace patch cable or clean/replace fiber and optics.
  4. Confirm speed/duplex settings match on both sides.
  5. Check logs for flap events around the same timestamp.

Drops

  1. Separate input drops from output drops.
  2. Compare interface rate against capacity.
  3. Check QoS policy, queue counters, and whether the link is an oversubscribed uplink.
  4. Treat queue tuning as secondary. First prove whether the link is congested.

Duplex And Speed

Prefer auto-negotiation on modern Ethernet links when both sides support it. If one side must be fixed, configure both sides explicitly and document why. Never mix fixed speed/duplex on one side with auto on the other.

show interfaces <interface> | include duplex|speed

Safe Parser Example

Slice each interface block from one header to the next. Do not use an arbitrary character window; large interface blocks can cause counters to be missed or assigned to the wrong port.

import re
from typing import Any

HEADER_RE = re.compile(
    r"^(?P<name>\S+) is (?P<status>(?:administratively )?down|up), "
    r"line protocol is (?P<protocol>up|down)",
    re.I | re.M,
)
ERROR_RE = re.compile(r"(?P<input>\d+) input errors, (?P<crc>\d+) CRC", re.I)
DROP_RE = re.compile(r"(?P<output>\d+) output errors", re.I)
DUPLEX_RE = re.compile(r"(?P<duplex>Full|Half|Auto)-duplex,\s+(?P<speed>[^,]+)", re.I)

def parse_show_interfaces(raw: str) -> list[dict[str, Any]]:
    headers = list(HEADER_RE.finditer(raw))
    interfaces = []
    for index, header in enumerate(headers):
        end = headers[index + 1].start() if index + 1 < len(headers) else len(raw)
        block = raw[header.start():end]
        errors = ERROR_RE.search(block)
        drops = DROP_RE.search(block)
        duplex = DUPLEX_RE.search(block)
        interfaces.append({
            "name": header.group("name"),
            "status": header.group("status"),
            "protocol": header.group("protocol"),
            "duplex": duplex.group("duplex") if duplex else "unknown",
            "speed": duplex.group("speed").strip() if duplex else "unknown",
            "input_errors": int(errors.group("input")) if errors else 0,
            "crc_errors": int(errors.group("crc")) if errors else 0,
            "output_errors": int(drops.group("output")) if drops else 0,
        })
    return interfaces

Examples

CRCs On One Switch Port

  1. Capture counters on the local port.
  2. Capture counters on the connected remote port.
  3. Replace the cable or optic before changing routing or firewall rules.
  4. Clear counters only after recording the baseline.
  5. Recheck after a fixed interval.

Internet Slow But LAN Is Fine

  1. Check WAN interface drops/errors.
  2. Check LAN uplink utilization and output drops.
  3. Check gateway CPU if the WAN link is clean but throughput is still low.
  4. Compare wired and wireless tests before blaming upstream service.

Anti-Patterns

  • Clearing counters before saving a baseline.
  • Looking at only one side of a link.
  • Assuming all historical CRCs are active problems without a time window.
  • Mixing auto-negotiation on one side with fixed speed/duplex on the other.
  • Treating output drops as a cable problem before checking congestion.

See Also

  • Agent: network-troubleshooter
  • Skill: network-config-validation
  • Skill: homelab-network-setup