I also had to modify the script a little to work. My other drive states only standby when spun down and unknown when spun up.
I just modified the script to check standby state to calculate spun down disk
if (strpos($result,"standby") ) {
$totalSpunDown++;
}
Log after the change (at first both disks running, then spinning them down one at a time):
Dec 16 22:31:40 Dunkin root: #012/dev/sdc:#012 drive state is: active/idle
Dec 16 22:31:40 Dunkin root: #012/dev/sdf:#012 drive state is: unknown
Dec 16 22:31:40 Dunkin root: Total Spundown: 0
Dec 16 22:31:58 Dunkin emhttpd: req (55): cmdSpindown=disk1&startState=STARTED&csrf_token=****************
Dec 16 22:31:58 Dunkin kernel: mdcmd (131): spindown 1
Dec 16 22:32:10 Dunkin root: #012/dev/sdc:#012 drive state is: standby
Dec 16 22:32:10 Dunkin root: #012/dev/sdf:#012 drive state is: unknown
Dec 16 22:32:10 Dunkin root: Total Spundown: 1
Dec 16 22:32:10 Dunkin root: Entering Normal Mode
Dec 16 22:32:10 Dunkin kernel: mdcmd (132): set md_write_method 0
Dec 16 22:32:10 Dunkin kernel:
Dec 16 22:32:13 Dunkin emhttpd: req (56): cmdSpindown=disk2&startState=STARTED&csrf_token=****************
Dec 16 22:32:13 Dunkin kernel: mdcmd (133): spindown 2
Dec 16 22:32:40 Dunkin root: #012/dev/sdc:#012 drive state is: standby
Dec 16 22:32:40 Dunkin root: #012/dev/sdf:#012 drive state is: standby
Dec 16 22:32:40 Dunkin root: Total Spundown: 2
btw hitting 1 gigabit/s (lan max) now with turbo mode, nice!