I've written a handful of ebooks over the past couple of years. They aren't going to make me rich but they have paid for the time I spent writing them, and continue to bring in a bit of money each month. I don't regret it at all, and I plan to continue.
Two things that might possibly help others going down the same route. They are technical books on programming, so I find Leanpub generates more sales than Amazon (see my page https://leanpub.com/u/martinmcbride).
Also they are all on a similar topic, Python programming, and I have a related website pythoninformer.com that seem to bring in most of the sales. I've never had much luck with paid adverts.