To diagnose the cable in D-Link switches, take the DES-3200 model as an example, just type:
cable_diag ports PORT_NUMBER
For example, perform the diagnostics of ports 1 through 5:
cable_diag ports 1-5
Via the web interface, this function can be found in the “Monitoring” -> “Cable Diagnostic“.
The test can show the distance at which the cable may be damaged.
See also my articles:
Cable test on ZyXEL MES-3528
Cable test on Foxgate S6224-S4
Cable test for Huawei Quidway S2326