I have two new Cisco switches connected to each other with a fibre cable.
Does anyone know any CLI commands to test the fibre cable from any of the two switches?
(I know there is the command "test cable-diagnostics ... etc". But, this only works with copper)
The SFPs don't have DOM capabilities.
Yes and no.
"Traditional" SFP such as the GLC-SX-MM or GLC-LH-SM are not DOM-capable. Cisco has released the End-of-Sale announcement for the non-DOM SFP and the replacement parts are the DOM-capable SFP.
Whether you will be able to view the optical transmit and receive levels will depend on the optical transceivers that are installed in the equipment. The following document outlines the transceivers that support the DOM capabilities.
Without DOM enabled transceivers, the only way to test the fibers is as described by rayframe1; with a light source and power meter.
There's nothing to test the fiber directly, other than a separate fiber tester device like a light meter or an OTDR
What is usually done is to compare the optical TX and RX levels on both sides, to ensure the signal is within range, if its within range you should be OK. The optical levels are usually found in the show interface transceiver or show controllers interface or show interface detail, you may have to search to find this, don't be confused by the TX and RX thresholds
If for example on the first side the optical levels show TX is 1 and RX is -5 and the facing side has TX 1 and RX -22 then the facing side is RX'ing a lot worse signal than the first side. The loss across in one direction is 6 dBm and the other way is 23 which would indicate a connection problem. Note; a -40 or -50 or -80 means no signal
Depending on what you see you troubleshot from there