want leds to change to hard drive activity

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

want leds to change to hard drive activity

Postby TheDurtch » Thu May 10, 2012 5:48 am

i would like to get my goflex net to blink orange every time there is hard drive activity, is this possible and if so how would i achieve this
TheDurtch
 
Posts: 28
Joined: Wed May 02, 2012 2:59 pm

Re: want leds to change to hard drive activity

Postby hydro » Thu May 10, 2012 1:00 pm

There's something outlined here, but I'm not sure if it's the best way of implementing and I don't know if LEDs on the goflex net are accessed in the same way.
$this->bbcode_second_pass_code('', '
pacman -S sysstat
iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/default-on/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:orange\:fault/trigger &
')
Last edited by hydro on Thu May 10, 2012 5:11 pm, edited 1 time in total.
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: want leds to change to hard drive activity

Postby TheDurtch » Thu May 10, 2012 4:29 pm

HAHAHA it works very well thank you. now to change it so it's not orange when idle...
TheDurtch
 
Posts: 28
Joined: Wed May 02, 2012 2:59 pm

Re: want leds to change to hard drive activity

Postby hydro » Thu May 10, 2012 5:11 pm

replace default-on with none
VDR on DockStar / Pogoplug E02: http://linux.bplaced.net/
hydro
 
Posts: 210
Joined: Wed Jun 15, 2011 2:03 pm
Location: Germany

Re: want leds to change to hard drive activity

Postby Drfrag » Wed Jun 27, 2012 5:52 pm

$this->bbcode_second_pass_quote('TheDurtch', 'H')AHAHA it works very well thank you. now to change it so it's not orange when idle...

For a weird reason the orange led on Pogoplug is called blue :)
So I decided to insert this lines on rc.local so when Pogoplug finishes its boot process, everything in done
and the orange led turns off before the green one turns on.

sudo nano /etc/rc.local

echo none > /sys/class/leds/status\:blue\:health/trigger

iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/default-on/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:green\:health/trigger &
Drfrag
 
Posts: 1
Joined: Tue May 01, 2012 6:53 pm

Re: want leds to change to hard drive activity

Postby moonman » Thu Jun 28, 2012 5:23 am

Thanks for this, I was looking for something similar for a while. I only wish it was more precise, like on a computer.

On GoFlex Home I like this line better:
$this->bbcode_second_pass_code('', 'iostat -z -d 1 sda | sed -u -e '1d' -e 's/Device.*/none/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:orange\:fault/trigger &')

Green LED is always on, and orange blinks on sata hdd access and orange isn't always on.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: want leds to change to hard drive activity

Postby TheDurtch » Thu Jan 24, 2013 7:24 am

$this->bbcode_second_pass_code('', '[root@alarm ~]# iostat -z -d 1 dm-0 | sed -u -e '1d' -e 's/Device.*/default-on/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:orange\:fault/trigger &
[9] 514
[root@alarm ~]# sed: couldn't flush stdout: Invalid argument
^C
[9]+ Exit 4 iostat -z -d 1 dm-0 | sed -u -e '1d' -e 's/Device.*/default-on/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:orange\:fault/trigger
')

i am trying to get the orange light to blink at LVM activity but it is not working any idea's?
TheDurtch
 
Posts: 28
Joined: Wed May 02, 2012 2:59 pm

Re: want leds to change to hard drive activity

Postby moonman » Thu Jan 24, 2013 6:13 pm

Can you see any output if you just run
$this->bbcode_second_pass_code('', 'iostat -z -d 1 dm-0')
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: want leds to change to hard drive activity

Postby TheDurtch » Thu Jan 24, 2013 6:47 pm

$this->bbcode_second_pass_quote('moonman', 'C')an you see any output if you just run
$this->bbcode_second_pass_code('', 'iostat -z -d 1 dm-0')



yup i get
$this->bbcode_second_pass_code('', '# iostat -z -d 1 dm-0

Linux 3.1.10-15-ARCH (alarm) 01/24/2013 _armv5tel_ (1 CPU)

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
dm-0 75.84 2960.92 3564.92 127947609 154047872

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
dm-0 72.00 700.00 352.00 700 352

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
dm-0 99.00 6596.00 1068.00 6596 1068

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
dm-0 73.00 8288.00 0.00 8288 0
')
TheDurtch
 
Posts: 28
Joined: Wed May 02, 2012 2:59 pm

Re: want leds to change to hard drive activity

Postby Obihoernchen » Thu Jan 31, 2013 3:32 am

I've made a systemd service to autostart this blink action :D

The quote is for PogoplugV2 users only!
$this->bbcode_second_pass_quote('', 'T')his is for PogoplugV2 with correct arcNumber.
If your arcNumber is wrong (orange LED on) then you should fix it:
$this->bbcode_second_pass_code('', 'pacman -S uboot-env
fw_setenv arcNumber 3542
fw_setenv machid dd6
reboot')


I've increased the iostat interval from 1s to 3s because I think that's enough and it will reduce load.

You need iostat so install sysstat:
$this->bbcode_second_pass_code('', 'pacman -S sysstat')

Create a new file called
/usr/lib/systemd/system/blinkled.service
$this->bbcode_second_pass_code('', '[Unit]
Description=Blink LED if hard drive is active daemon

[Service]
Type=oneshot
ExecStart=/usr/local/bin/blinkled
ExecStop=/usr/bin/killall iostat
RemainAfterExit=true

[Install]
WantedBy=multi-user.target')

And another one called
/usr/local/bin/blinkled
$this->bbcode_second_pass_code('', '#!/bin/bash
/usr/bin/iostat -z -d 3 sda | /usr/bin/sed -u -e '1d' -e 's/Device.*/none/' -e 's/sd.*/heartbeat/' -e '/^$/d' > /sys/class/leds/status\:orange\:fault/trigger &')
Make executable:
$this->bbcode_second_pass_code('', 'chmod u+x /usr/local/bin/blinkled')

Now you can use systemctl to control this service :)
To enable:
$this->bbcode_second_pass_code('', 'systemctl enable blinkled.service')
To start:
$this->bbcode_second_pass_code('', 'systemctl start blinkled')

Hope you like it!

btw: arch linux is great!
I'm able to get ~19MB/s read and 11MB/s write via Samba NTFS :o with some mount and TCP tuning and 3.7.5 Kernel
More than twice as fast as stock :D
Last edited by Obihoernchen on Wed Feb 06, 2013 6:01 am, edited 1 time in total.
Visit my Blog for Pogoplug guides
Obihoernchen
 
Posts: 17
Joined: Thu Jan 31, 2013 3:17 am
Location: Germany
Top

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 7 guests