On my NAS I'm trying to reduce power consumption by spinning down disks when they're not used. However I noticed that after a while the disks kept on spinning up and thus kept running 24/7.
Manually shutting down the disks didn't help either, disks were up soon after.
I tried to find out which process was accessing the disk, causing it to wake up : * using inotifywatch, no file access was reported, though the disk spun up * same outcome activating /proc/sys/vm/block_dump
So disks were spinning up though there was no filesystem access...
Next step was to shutdown all involved daemons to figure out which one was the root cause : nfs-kernel-server, samba, apache... to finaly find out OMD was the guilty !
OMD monitors the disk usage ('df' command), but this doesn't trigger the disk spin up. It also queries the disk's status through smartctl. And this seems to spin the disk up in order to get the data (according to this blog !
The solution is also included in the blog : "The above command spins up the hard drive. To prevent this the -n flag can be passed additionally with the value standby to smartctl"
So I modified /usr/lib/check_mk_agent/local/smart, adding -n standby to alll invocations of smartctl.
So far disks are in permanent standby, mission completed !
Only drawback is that the smart agent is now reporting no data for the disk while it is sleeping, therefore OMD reports the according servies as "unknown" and issues notifications per email - I assume this can be tweaked away.