How is it possible to detect system wide segmentation? In this post, MoonShadow says it's easy to detect system wide segmentation. 


  Yet a system wide segmentation is fairly easy to detect, the current client just doesn't do it.  If code implementing my 'watchdog' idea were included, the client could be set to suspend automatic trading on websites or warn the user of a fault on interactive clients.


How would that be accomplished technically speaking?
What happened in the March 2013 fork was that two different versions of the bitcoin client disagreed about what a valid block was. You could look for a block reorg, but that will only show up when the fork is fixed. How could you detect a hard fork as soon as it happens?
Well, you could run 5 different versions of the bitcoin client at once, then figure out when they get out of sync for a few minutes. That's when you know there's a version-specific fork. I should note that this is mainly aimed at getting the client fixed faster, not protecting a merchant.
Detecting being out of sync
You could write a program that polled all of clients looking for their latest block.
Psuedocode:
run on each node
  block number = node.getblockcount()
  latest block = node.getblockbycount(block number)
  latest block hash = latest block['hash']

Oh, by the way, this requires the getblock patch.
Now, if these differ for more than a minute or so (and you're not still in the initial syncing phase) then you might have a hard fork.
Making sure you have a good connection to the network
Let's say that you had a 0.8 client that was only connected to 0.7 clients. Even though it would have accepted the blocks in the March fork, it never even hears about them, meaning we won't detect the fork.
I'm not sure how to solve this. Perhaps upping MAX_OUTBOUND_CONNECTIONS ?
Preventing false alerts
If network conditions were really bad, then it's possible that one client would receive a new block, but the others wouldn't. You should use addnode to make them all talk to each other.