I like this solution, thought I am not so sure I would dedicate a RPi to it. The author basically uses a 9-volt battery connector to test if the water has gone up too high (it shorts the connection). And the RPi sends out the alert.
http://lowpowerlab.com/blog/2013/04/25/sump-pump-alert-with-moteino-hc-sr04/