Linux – Munin “Available entropy” when using address space layout randomization

entropy-poollinuxlinux-kernelmuninrandom-number-generator

Having just configured Munin for statistics logging on my gentoo server (hardened profile), I am noticing that my "Available entropy" is consitently in the 200-300 range. This seems way to low, so I checked it manually using the command

$ cat /proc/sys/kernel/random/entropy_avail
3544

Odd. Consistently very low values in Munin and practically filled up when checking manually. After thinking about the problem for a while I came to the conclusion that the problem is probably that I'm using Adress Space Layout Randomization which is using the entropy when running commands/programs. Since Munin runs a whole slew of programs all the entropy is used up, and Munin then measures how much entropy there is, resulting in the low values.

Does anyone have any experience with this? How can this be avoided?

Best Answer

Another similar solution would be to a new entropy plugin that

  1. prints the previously cached result.
  2. forks.
  3. sleeps for, say, 3 minutes.
  4. extracts the entropy using the original entropy Munin plugin and saves it to cache.

The good thing about this solution is that it would not require you to involve cron.

Since Munin plugins usually are run every fifth minute this would mean your entropy would be 2 minutes delayed but it certainly sounds a lot better than incorrect data.