I will give an example of cable diagnostics on ZyXEL switches, for the test I will take the ZyXEL MES-3528 switch.
An example cable diagnostic command (where 2 is the port number):
You can test multiple ports at once:
Command result example:
cable-diagnostics 2 port 2 cable diagnostics result pairA: Ok pairB: Ok
See also my articles:
Cable test on Huawei Quidway S2326
Cable Diagnosis in D-Link Switches