Is this passage in the Pali Canon?

I came across the passage below maybe ten years ago; I rather like it, and it sounds like it comes from the Canon (if it’s not, whoever composed it is certainly familiar with the style of the Canon), but I have no attribution for it. Does anybody know if this is from the Canon, and where?

“Governments and royal rule, Ananda, are nuisances like robbers, pestilence, famine, mosquitoes, gnats, and so forth. It is a wise man indeed who has learned to endure them with fortitude.”

I don’t know where this could possibly be; it’s nowhere in the Nikayas, as far as I can tell.