I'm not an expert, but that's how it should work:
Clients - at least those that are based on the Bitcoin design - detect all blocks (if the network is not partitioned) that are propagated in the network. Every block received should be announced in the debug.log file. So in the debug.log you would see if blocks are accepted on the chain where your client is "residing" or not.
So you can conclude that all blocks that are not accepted by your client belong to other chains (or are invalid because of other reasons). You should be able to collect their hashes from debug.log and follow the chain to its origin following the "hashPrevBlock" values. If you do that for all "not accepted" blocks, you should be able to detect all chains.
Maybe there is a script that could do that. It shouldn't be hard to code it.
(I just read
here about the -printblocktree option. Haven't tried it, but that should do the trick - you would have to observe the debug.log then.)