Anyway to monitor hard drive activity with the blink(1)?

  • Question
  • Updated 2 years ago
  • Answered
If this is at all possible can someone whip up a quick script?
On windows and dont have the control program yet :(
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like

Posted 2 years ago

  • 1
Photo of YoYo-Pete

YoYo-Pete

  • 89 Posts
  • 16 Likes
What do you want it to do? How do you envision it working?
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like
My tower is on the floor facing away so i cant always see the hard-drive activity, i was looking for a way to make the blink(1) light upon hard drive activity. Maybe color code it based on longer activity, but just having it blink under and activity would be great!
Photo of IBMJunkman

IBMJunkman

  • 6 Posts
  • 0 Likes
I 2nd this idea. The HD activity light on my PC is very dim and even though it is right next to me I can't easily see it. I run a gadget that shows me read and write activity but a blinking light would be better.
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like
I should also note this is on a windows 7 machine!
Photo of YoYo-Pete

YoYo-Pete

  • 89 Posts
  • 16 Likes
I'll see if I can make something up in visual studio to do something like this. No promises.
Photo of IBMJunkman

IBMJunkman

  • 6 Posts
  • 0 Likes
Windows 7 64 for me.
Photo of todbot

todbot, Official Rep

  • 611 Posts
  • 155 Likes
Here's a quick and very hacky VB script to flash blink(1) red & green based on write & read disk activity:

https://github.com/todbot/blink1/blob...

This is not a very good solution and I bet YoYo-Pete will make something much better.

btw, I found the very awesome WMI Code Creator from Microsoft to be extremely useful for finding interesting info about your computer that could be turned into blink(1) colors.
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like
thanks tod! and im interested to see what YoYo-Pete can come up with as well!

Glad you guys took the time to consider!

Edit: I will give this script a try when i get home from work, got about 2 and a half hours before i can play!
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like
Works fairly well, wish i could make it go a bit faster, but may either be software or hardware related, works better than what i had! wish i could figure out how to change the colors though.
Photo of YoYo-Pete

YoYo-Pete

  • 89 Posts
  • 16 Likes
Todbot delivered better than I could... My area of expertise is cloud/web/services... hardware level stuff is a stretch for me. (but it is something I like/want to dabble with).

Changing the speed is easy: Wscript.Sleep 1000
That means every second. Time is in milliseconds. Lower that value to make it go faster. Note that too low of a value might create performance issues as it's trying to do things too often.

Color is odd.

Todbot is using PercentDiskWriteTime & PercentDiskrReadTime. I'm not really sure what that means.

There's DiskWritesPersec and DiskWritesPersec. I dont know what hind of values those return but my thought was to go from black to red, or green to red, based on how much it's reading/writing. More activity is more red.

Currently it's looking like todbot is using a blending to show read & writes. More red in the color means more writes. More green is more reads.
--------------------------------------------------------------------
red = Int( objDisk.PercentDiskWriteTime * 255 / 100 )
grn = Int( objDisk.PercentDiskReadTime * 255 / 100 )
--------------------------------------------------------------------

Since it's one disk, it might make more sense to convert the values into a single value from 0 to 100% and derive the color from that.
--------------------------------------------------------------------
PercentAsInteger = Int( (objDisk.PercentDiskWriteTime + objDisk.PercentDiskWriteTime) * 255 / 100 )
(note, not sure if this is the correct way to do it, but the idea is to combine them into one value)
--------------------------------------------------------------------
Here's some examples that I wrote in python... mocked up into VBA (untested).

Take a percentage and make black to red:
--------------------------------------------------------------------
colorLevel = int(round(255 * ( PercentAsInteger / 100.0)))
Run "blink1-tool.exe -m 50 --rgb " & colorLevel & ",0,0"
--------------------------------------------------------------------
Or do it from Green to Red:
--------------------------------------------------------------------
v_red = 0
v_green = 0
v_blue = 0

if PercentAsInteger > 50:
v_green = 255.0*(1.0-2.0*(PercentAsInteger -50.0)/100.0)
v_red = 255.0*(1.0)
else:
v_green = 255.0*(1.0)
v_red = ((PercentAsInteger /100.0)*2.0)*255.0

Run "blink1-tool.exe -m 50 --rgb " & v_red & "," & v_green & "," v_blue
--------------------------------------------------------------------
Photo of Tyler EynonTE

Tyler Eynon

  • 8 Posts
  • 1 Like
still have no idea how to change the read color to blue...
Photo of YoYo-Pete

YoYo-Pete

  • 89 Posts
  • 16 Likes
Replace this:

     Run "blink1-tool.exe -m 50 --rgb " & red & "," & grn & ",0"

With this:

     Run "blink1-tool.exe -m 50 --rgb " & red & ",0," & grn