c. 1300, from Old English eglan "to trouble, plague, afflict," from Proto-Germanic *azljaz (source also of Old English egle "hideous, loathsome, troublesome, painful;" Gothic agls "shameful, disgraceful," agliþa "distress, affliction, hardship," us-agljan "to oppress, afflict"), from PIE *agh-lo-, suffixed form of root *agh- (1) "to be depressed, be afraid." Related: Ailed; ailing; ails. From late Old English also of mental states and moods.
It is remarkable, that this word is never used but with some indefinite term, or the word no thing; as What ails him? ... Thus we never say, a fever ails him. [Johnson]