Page 1 of 1

add status column to Disk |Info to see if disk is instandby.

Posted: 10 Sep 2013 09:46
by raulfg3
Actually is not easy to know if my disk are in standby or not, I configure parameter in WebGUI to select "Disable,5mint, 10, etc...", But Is not possible to see or to know if the disk go to standby really or not.

I think is a great ad-on to Disk | Info page ( recently tempt was added, so why not status? )

Re: add status column to Disk |Info to see if disk is instan

Posted: 10 Sep 2013 09:56
by ChriZathens
Judging by the temperature addition, where I actually hear the disks spinning up before the system actually shows their temperature, I would say that it will always show them as spinning...
It would really be a good addition, but I think it should be added in a different page..somewhere where no temp is retrieved..

Re: add status column to Disk |Info to see if disk is instan

Posted: 10 Sep 2013 11:36
by raulfg3
YES, you are right, if temp is show, disk are spinnning, I do not think well , but still think is a good addition , perhaps in other page , index.php ?

Re: add status column to Disk |Info to see if disk is instan

Posted: 11 Sep 2013 00:27
by RedAntz
This is actually in 1 of my TODO list :P .

However, I'd like to focus on getting existing controller detection into trunk first to avoid scope creep. Otherwise it will sit in experimental branch forever.

Having said that, the reason hard disk spins up is because of smartctl commands issued during device type auto-detection.
See https://forums.freebsd.org/showthread.php?p=232186

That rules out Diagnostics|Information|Disks, Disks|Management or Status|Disks page as smartctl provides a lot of the information displayed (Serial / device model / temperature ...) . Real time detection means they will spin up when you refresh those pages (although i'd love to put this info in STATUS column ... let's see if I can find a way to get around it when I work on this :) )

Re: add status column to Disk |Info to see if disk is instan

Posted: 11 Sep 2013 19:00
by crest
Hi,

I already have the disk state (standby, active = spinning) and the temperature on the status page of the webGUI (see screenshot in my post => viewtopic.php?f=56&t=3797) with some patches of index.php and a shell script.

Edit:
@raulfg3 & RedAntz: at least on both of my two servers I see the temperature regardless if the disks are spinning or not, but possibly on certain systems / controller / disk types this is not possible. To prevent disks spinning up I check if they are in standby mode:

Code: Select all

smartctl -n standby -q silent -A $DEVICE_NAME
and print out the state and temperature. Btw, after upgrading to the actual release (847) I discovered that it is possible to retrieve the disk temperature also if the disks are spun-down without spinning them up (new version of smartctl ?), but as I said before, this must not be valid for all systems ...

Code: Select all

	2) MSG="<font color="darkgreen">Standby</font>"; MSG_TEMP=`smartctl -A $DEVICE_NAME | awk '/Temperature_Celsius/ {print $10}'`;;
You will find this in the script => hd_status.sh, which is called from the modified index.php => index.php.

The output on index.php:
Image

I did not incorporate zfs pools because currently I'm not running them.

Regards,
crest

Re: add status column to Disk |Info to see if disk is instan

Posted: 14 Sep 2013 13:53
by raulfg3
crest wrote:I already have the disk state (standby, active = spinning)
I see that you are a php/coder guru, perhaps is better / easy for you to modify status_disks.php to show in status if disk are in standby or active, I find it more usefull that actual status show that only show "active" or missing.

If you post a modified status_disks.php and/or hd_status.sh for this , I'm the first that want to test.

Re: add status column to Disk |Info to see if disk is instan

Posted: 16 Sep 2013 21:11
by crest
raulfg3 wrote:
crest wrote:I already have the disk state (standby, active = spinning)
I see that you are a php/coder guru, perhaps is better / easy for you to modify status_disks.php to show in status if disk are in standby or active, I find it more usefull that actual status show that only show "active" or missing.

If you post a modified status_disks.php and/or hd_status.sh for this , I'm the first that want to test.
not really a guru ;) , just playing around and try to improve the GUI to fit my needs.

Here we are, I needed to change two files => system.inc (to prevent spin-up of the disks) and => status_disks.php for the presentation of the disk activity. I know it's a quick 'n' dirty solution but it works on my server.

Image

If you want to try it please replace

Code: Select all

system.inc => /etc/inc/system.inc
and

Code: Select all

status_disks.php => /usr/local/www/status_disks.php

The file system.inc must be loaded with a pre/postinit command, status_disks.php can be replaced at any time.

Regards,
crest

Re: add status column to Disk |Info to see if disk is instan

Posted: 16 Sep 2013 21:58
by raulfg3
Thanks a lot crest, is was I need, but on my system do not work.
I lose temp, and status is always =stanby and do not change ( and I start a coy of 8GB file to be sure that disk is spinning), some screen captures before ( actual N4F 847 x64):
normal.jpg
and after change your 2 modified files:
diskstatus.jpg
I have no problem to test/send/atach any command that you want to probe in my system (my disk), only tell me what you need, if others user can confirm that work on his system I'll try to add this usefull addon to repo so perhaps zoon01 can include this by default and no need to do a postinit copy.

Re: add status column to Disk |Info to see if disk is instan

Posted: 16 Sep 2013 22:43
by alexey123
Look fine standby and temperature.
But I love my statistic.
Image
Image

crest, your addon look fine, create extension, where you can enable/disable futures on disk and index page ( simple replace original system and disk management pages)

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 08:07
by crest
raulfg3 wrote:Thanks a lot crest, is was I need, but on my system do not work.
I lose temp, and status is always =stanby and do not change ( and I start a coy of 8GB file to be sure that disk is spinning), some screen captures before ( actual N4F 847 x64):

...

I have no problem to test/send/atach any command that you want to probe in my system (my disk), only tell me what you need, if others user can confirm that work on his system I'll try to add this usefull addon to repo so perhaps zoon01 can include this by default and no need to do a postinit copy.
Please download system.inc again, I've updated it and now it should work as expected (for some reason it was not the correct version ... :oops: ).

Please can you also try this version -> system.inc => /etc/inc/system.inc. It shows the temperature also in disk standby mode but CAN perhaps lead to spin-up a drive. Would be interesting to see how / if it works on other systems.

Btw, during my tests I discovered that - under DISKS | MANAGEMENT - disable SMART has no effect on a drive which had enabled SMART before ... not really a big issue but looks like a minor bug

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 09:05
by crest
alexey123 wrote:Look fine standby and temperature.
But I love my statistic.

...

crest, your addon look fine, create extension, where you can enable/disable futures on disk and index page ( simple replace original system and disk management pages)
Thank you ;) ... I've uploaded a new version of system.inc, can you please try if this works too on your system.

Interesting idea to build an extension, haven't done this yet but I will try if I have a bit more time ...

Your MRTG graphs looks really good, I like it. Did you notice if collecting the data for the graphs let the drives spin all the time? I found this post http://www.forums.nas4free.org/viewtopi ... =45&t=1445 from you, I will give it a try as soon as I know that MRTG leaves the drives in standby ... :)

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 09:22
by alexey123
crest wrote:Interesting idea to build an extension, haven't done this yet but I will try if I have a bit more time ...
OK, I'll check how to help you. Extension is tru way, You not need modify any firmware file, so you can update NAS4Fee main server without any problem.
Your MRTG graphs looks really good, I like it. Did you notice if collecting the data for the graphs let the drives spin all the time? I found this post http://www.forums.nas4free.org/viewtopi ... =45&t=1445 from you, I will give it a try as soon as I know that MRTG leaves the drives in standby ... :)
Ooooh, this is my old example. Now I use embedded versions only and my MRTGs running under jail. Currently I have drives "allways on" but I want use sleep state at my home. I create article about MRTG under jail, when I repair scripts for sleeping

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 10:05
by crest
alexey123 wrote:OK, I'll check how to help you. Extension is tru way, You not need modify any firmware file, so you can update NAS4Fee main server without any problem.
Yes, I would really appreciate you help - I was thinking about building extensions for a long time but, ...
alexey123 wrote:Currently I have drives "allways on" but I want use sleep state at my home. I create article about MRTG under jail, when I repair scripts for sleeping
... repair? perhaps I can support you in this case?

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 10:33
by alexey123
crest wrote:
alexey123 wrote:... repair? perhaps I can support you in this case?
I've already looked at your scripts and I need just remember a little change to the current script.
Now all my free time I work on update TheBrig ...

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 18:01
by alexey123
Check attachment. micro howto:
1. Create holding folder for it. In my case - /mnt/disk/app
2. Download into holding folder archive and

Code: Select all

tar xzf silent_disk.tgz
3.

Code: Select all

php-cgi silentdisk_install.php
Observe result on webgui under Extension.
I make backups for original system files, you can use original and silent files.
I see in last disk on index.php troubles - empty temperature.
Image
Also temperatures not online, but this issue repairable

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 22:35
by raulfg3
crest wrote:Please download system.inc again, I've updated it and now it should work as expected (for some reason it was not the correct version ... :oops: ).
OK, I do.

Temp is show correct on two system, my production NAS and my test NAS.
new column Activity is show correct for ada0 to ada5 in my NAS (SATA integrated on mainboard: ASUS P5Q-WS )
But do not work for my 8SATA SAS 3081E-R
spinning in my NAS.jpg
On my Test NAS, Temp works fine, but Activity allways show Standby and I totally sure that is spinning, my test NAS is a HP DC5700 http://h20566.www2.hp.com/portal/site/h ... .199480143
Temp OK.jpg

Re: add status column to Disk |Info to see if disk is instan

Posted: 17 Sep 2013 23:02
by alexey123
Raul right
smartcontrol in all cases wake from standby disks. But disk know standby mode, I hear the disk accelerates and stops

Image

Uuups :cry: :oops:

Re: add status column to Disk |Info to see if disk is instan

Posted: 18 Sep 2013 08:16
by crest
alexey123 wrote:Raul right
smartcontrol in all cases wake from standby disks. But disk know standby mode, I hear the disk accelerates and stops
I nerver heard the disks accelerating and stopping when I use "-n standby" ... ?

Image

pls try it again with "-n standby", should not accelerate disks ... at least on my server with this command the drives don't and smartctl terminates with exit code 2 (which is correct in this case).
alexey123 wrote:Check attachment. micro howto:
1. Create holding folder for it. In my case - /mnt/disk/app
2. Download into holding folder archive and

Code: Select all

tar xzf silent_disk.tgz
3.

Code: Select all

php-cgi silentdisk_install.php
Observe result on webgui under Extension.
WOW, great, thank you very much...
I installed the extension, on a Virtualbox it worked like a charm, on my physical server not, have to dig in why ...
alexey123 wrote:I see in last disk on index.php troubles - empty temperature.
I will check this in the hd_status.sh script, shouldn't be that problem ...
alexey123 wrote:Also temperatures not online, but this issue repairable
I didn't implement this, have to look how to do ...

Re: add status column to Disk |Info to see if disk is instan

Posted: 18 Sep 2013 08:41
by alexey123
crest wrote: I installed the extension, on a Virtualbox it worked like a charm, on my physical server not, have to dig in why ...
Extension, when you install it make backup original index.php, system.inc and disks_status.php from current server. Then simple swich files.
May be you use on server modified files? ;)
For fast repair issue put into extension folder silent_disks original files from virtual box.

Generaly my problem is:
I can send disk to any mode( sleep, idle, standby) . But! When smartctl touch disk, mode jump to standby (in Lab server) or Active or IDLE at home server. Disk begin to rotate. I want true silent check, but I have no idea for do it with FreeBSD .
Why? I ready to attach any hardware termosensors, also I can switch zones over LPT (see my LPT addons , I prepare binaries for use LPT as swich for 254 sensors) and as analog input I can use CPU FAN ( viewable over mbmon! ) It will work.
But I haven't LPT at my home server and mbmon not work on it - need install and check ipmi-tools.
I want to replace my LAB server on HP D530 - it not have any analog input, it not show CPU temperature :( and fan speeds with all tests ) But it faster then my current server *4
I want a universal solution to the problem

Re: add status column to Disk |Info to see if disk is instan

Posted: 19 Sep 2013 22:25
by alexey123
I find scrip, which check state disk - spinning or not without smartctl. As for me - work great

Code: Select all

#!/bin/sh

camcontrol devlist | awk -F\( '{print $2'} | awk -F\, '{print $1}' |while read LINE
do
CM=$(camcontrol cmd $LINE -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r - | awk '{print $10}')
if [ "$CM" = "FF" ] ; then
echo "$LINE: SPINNING"
elif [ "$CM" = "00" ] ; then
echo "$LINE: IDLE"
else 
echo "$LINE: UNKNOWN"
fi
done
If use camcontrol instead smartctl, disk not begin to run.

Re: add status column to Disk |Info to see if disk is instan

Posted: 19 Sep 2013 23:04
by crest
alexey123 wrote:I find scrip, which check state disk - spinning or not without smartctl. As for me - work great

...

If use camcontrol instead smartctl, disk not begin to run.
Yes, looks very good BUT - in the meantime I did some tests, also with older PATA drives and there I found, that with the actuell release smartctl do not recognize if the drives are in standby or active. Therefore I tested with the script you sent and it's the same, camctrl also do not recognize the state (spinning, standby) - so I suppose that there is a problem wit FreeBSD in the actual version together with PATA drives ...?

I will do further tests and incorporate in status_disks.php when I am successfull.

Re: add status column to Disk |Info to see if disk is instan

Posted: 20 Sep 2013 07:27
by alexey123
crest wrote:Yes, looks very good BUT - in the meantime I did some tests, also with older PATA drives and there I found
NOT SAY ANYTHING ABOUT OLD PATA DRIVE!!!!111
FreeBSD 9 not know work with PATA. For example on disk config page we have controlbox Transfer mode.
Image

It not work because FreeBSD team make transfer speed into ata kernel maximum. But it was work on FreeBSD 7.
I've always used discs in that order. Windows - up to the second disk failure (approximately one and a half years), Linux - again to a second failure ( ~2 years +) freebsd - to death. If disk not work on freebsd, Hirens CD cannot repair it. But this true for FreeBSD < 7.
Now I have on FreeBSD machine some as windows - disk lifetime is 3 years.
that with the actuell release smartctl do not recognize if the drives are in standby or active. Therefore I tested with the script you sent and it's the same, camctrl also do not recognize the state (spinning, standby) - so I suppose that there is a problem wit FreeBSD in the actual version together with PATA drives ...?

I will do further tests and incorporate in status_disks.php when I am successfull.
I continue to study it.
I want chek disk activity and temperature without spinning disk UP, Up down up down - this is not good way, drives consume a lot of power when accelerating, sometimes it's better not to send a disk to sleep than to disperse it.
UPD
During transfer camcontrol says about driver is in standby mode.
Image
But I can send it to sleep with comand

Code: Select all

camcontrol sleep ada1
I go to server and check by hand - drive not spinning
I find very interest post

Re: add status column to Disk |Info to see if disk is instan

Posted: 20 Sep 2013 08:48
by alexey123
I continue. I make next commands
nas4free: data # date
Fri Sep 20 06:43:06 UTC 2013
nas4free: data # smartctl -n standby -i /dev/ada1
smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.1-RELEASE-p5 i386] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, http://www.smartmontools.org

Device is in STANDBY mode, exit(2)
nas4free: data # camcontrol sleep ada1
nas4free: data # smartctl -n standby -i /dev/ada1
smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.1-RELEASE-p5 i386] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, http://www.smartmontools.org

(pass1:ata1:0:1:0): CHECK_POWER_MODE. ACB: e5 00 00 00 00 40 00 00 00 00 00 00
(pass1:ata1:0:1:0): CAM status: Command timeout
Device is in SLEEP mode, exit(2)
nas4free: data # smartctl -n standby -i /dev/ada1
smartctl 6.2 2013-07-26 r3841 [FreeBSD 9.1-RELEASE-p5 i386] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, http://www.smartmontools.org

Device is in STANDBY mode, exit(2)
nas4free: data # date
Fri Sep 20 06:43:50 UTC 2013
nas4free: data #
When I check disk state it begin to spinning. Hmmmm? I go to read ata commands

Re: add status column to Disk |Info to see if disk is instan

Posted: 02 Jan 2014 23:56
by Snunn1
alexey123 wrote:
Ooooh, this is my old example. Now I use embedded versions only and my MRTGs running under jail. Currently I have drives "allways on" but I want use sleep state at my home. I create article about MRTG under jail, when I repair scripts for sleeping
You might like to use my guide HERE as a basis.

Hope this Helps
S.

Re: add status column to Disk |Info to see if disk is instan

Posted: 06 Jan 2014 10:39
by crest
Thank you for the hint! I used your guide and it was realy easy with it to setup MRTG.

regards
crest