Jump to content
olehj

[PLUGIN] Disk Location

198 posts in this topic Last Reply

Recommended Posts

On 1/23/2019 at 9:32 PM, olehj said:

The Locate function is very vague and only calls smartctl -x /dev/bsg/PATH every half second.

 

You can test manually by using that command, just replace PATH with the path number available (you can see it from the list, or by ls /dev/bsg). Everytime you run the command, the LED on the HD might light up. If the smart data does not work, goes too fast, then the locate button won't work either.

 

After multiple tests, targeting the same device for consistency:

 

- manual smart -x test always works. of course it's a short bleep, but it works flawlessly. if i shell loop it, i definitely get some flashing action.

- tried targeting the same exact device with the plugin (in this case 1:0:1:0). nothing. not even a tiny blink. tried triggering other disks. also tried spamming the Locate button multiple times. got nothing.

 

I definitely think there might be a code glitch there. The shell command definitely does what it should. The plugin, unfortunately, doesn't. Hope this helps.

 

Cheers!

 

EDIT: went ahead and checked the code on GIT and noticed you use a shell function called smartlocate. So, went ahead and tested it. Works flawlessly. So the issue seems to be between your PHP code shell call and the function. But I can't really debug deeper.

Edited by TeeNoodle
addon information

Share this post


Link to post
8 hours ago, TeeNoodle said:

EDIT: went ahead and checked the code on GIT and noticed you use a shell function called smartlocate. So, went ahead and tested it. Works flawlessly. So the issue seems to be between your PHP code shell call and the function. But I can't really debug deeper.

What web browser are you using? The call happens from javascript and has mainly been tested with newer Vivaldi, Chrome (both blink engines) and Firefox.
Be sure you haven't disabled javascript, or have any plugins/extensions disabling it.

 

Edit: And does the "Locate" button change to black background and does it say  "Stop" after clicking it?

Edited by olehj

Share this post


Link to post
12 hours ago, olehj said:

With the new update 2019.01.30b, you can try to deselect "Disk Operation LED" and check if the response will be faster. This runs an additional smart query for drives not in Unraid array. Then you can enable it when the creation of the array is done. A smart query is likely to run slower if the system is very busy, and also slower if it is an unassigned drive because it can't get cached unraid data.

Awesome my friend. Thank you for the “data to show” option. Much clearer for me.

 

I have yet to map all the drives to test. I am going to be removing the one un-assigned drive to see if it speeds things up.

 

i will report back.

 

thanks again!

Share this post


Link to post
1 hour ago, olehj said:

What web browser are you using? The call happens from javascript and has mainly been tested with newer Vivaldi, Chrome (both blink engines) and Firefox.
Be sure you haven't disabled javascript, or have any plugins/extensions disabling it.

 

Edit: And does the "Locate" button change to black background and does it say  "Stop" after clicking it?

I'm using Firefox (Win64-Win7) but just tested it on Chrome, to no avail. Button does toggle to black, as it should. Firefox has a few addons, nothing that should interfere with JS, but Chrome is stock. Seems like the JS calls work, but shell execution doesn't, for some reason. I tried starting the Location button, and doing a ps aux | grep smart a bunch of times while it's supposed to be running, and i never see the shell command pop in.

 

Cheers!

 

Share this post


Link to post
15 minutes ago, TeeNoodle said:

I'm using Firefox (Win64-Win7) but just tested it on Chrome, to no avail. Button does toggle to black, as it should. Firefox has a few addons, nothing that should interfere with JS, but Chrome is stock. Seems like the JS calls work, but shell execution doesn't, for some reason. I tried starting the Location button, and doing a ps aux | grep smart a bunch of times while it's supposed to be running, and i never see the shell command pop in.

 

Cheers!

 

If you go directly to the source file, does it give you a blank page (expected result) or does it say "File not found"?
Try to go to:

 

http(s)://<your address here>/plugins/disklocation/pages/locate.php

The "plugins" folder is expected to be at the root of the hostname/address, and not within another folder - at least for Unraid 6.6. I'm not sure if they changed that in later versions.

Edited by olehj

Share this post


Link to post
6 minutes ago, olehj said:

If you go directly to the source file, does it give you a blank page (expected result) or does it say "File not found"?

Getting a blank page

 

PS: i'm on 6.6.6, didn't upgrade yet.

Edited by TeeNoodle
precision

Share this post


Link to post
14 minutes ago, TeeNoodle said:

Getting a blank page

 

PS: i'm on 6.6.6, didn't upgrade yet.

It looks like this is a Windows specific problem, can you try to check if you see activity happening on 1:0:1:0 using this URL:

http://<your address>/plugins/disklocation/pages/locate.php?disklocation=1%3A0%3A1%3A0&cmd=start
Kill it running this:
http://<your address>/plugins/disklocation/pages/locate.php?cmd=killall

Share this post


Link to post

Hi,

 

Was checking out this plugin because. Seems to be very handy.

Installation of the plugin goes well. I'm fairly new to unraid so I dunno if it's me or the plugin but what I do know is that the html output says:

 

<b>Warning</b>:  require_once(styles/disk_.css.php): failed to open stream: No such file or directory in <b>/usr/local/emhttp/plugins/disklocation/pages/devices.php</b> on line <b>253</b><br />

which is not visible in the browers. I just get de tab "devices" and then blank..

I'm on 6.6.6.

 

Share this post


Link to post
2 minutes ago, sjoerd said:

Hi,

 

Was checking out this plugin because. Seems to be very handy.

Installation of the plugin goes well. I'm fairly new to unraid so I dunno if it's me or the plugin but what I do know is that the html output says:

 


<b>Warning</b>:  require_once(styles/disk_.css.php): failed to open stream: No such file or directory in <b>/usr/local/emhttp/plugins/disklocation/pages/devices.php</b> on line <b>253</b><br />

which is not visible in the browers. I just get de tab "devices" and then blank..

I'm on 6.6.6.

 

Ah, seems to have forgotten to define a variable there after the last database change. It should disappear when you save the config.

Share this post


Link to post
23 minutes ago, olehj said:

It looks like this is a Windows specific problem, can you try to check if you see activity happening on 1:0:1:0 using this URL

fantastic, i will test this tonight as soon as i get home. are you telling me you're testing it on Linux browsers?

 

Share this post


Link to post
4 minutes ago, TeeNoodle said:

fantastic, i will test this tonight as soon as i get home. are you telling me you're testing it on Linux browsers?

 

I'm mainly a hardcore linux user. I tried the function in Windows now, and it seems to have a bit more problems there. I did however succeed a few times, but it is way more unstable.

Share this post


Link to post
6 minutes ago, olehj said:

Ah, seems to have forgotten to define a variable there after the last database change. It should disappear when you save the config.

Euhm 🙂

I never installed any version of disklocation - there is nothing on the screen, no "Save"-button either.

 

Share this post


Link to post
7 minutes ago, olehj said:

I'm mainly a hardcore linux user. I tried the function in Windows now, and it seems to have a bit more problems there. I did however succeed a few times, but it is way more unstable.

So am i, brother (Linux sysadmin here), but that's my home desktop which is a gaming machine ;) In my case, I didn't manage at all, it's not even intermittent, the smartlocate function doesn't seem to be executed properly at all. Will keep you posted with the URL tests as soon as i get home.

 

Cheers

Share this post


Link to post
8 minutes ago, sjoerd said:

Euhm 🙂

I never installed any version of disklocation - there is nothing on the screen, no "Save"-button either.

 

Aha, so it is completely empty? Wait for the next version then, and delete the plugin for now. I have fixed the issue, but it won't be available just yet. Expect it later today/tomorrow.

Share this post


Link to post

Update 2019.01.31

- Commit #29 - BUG: Locate button acting weirdly, especially under Windows(?). Added escape and encode. Also modified the bash script.

- Commit #28 - Minor issue: break-variable missing from the Unraid LEDs.

- Commit #27 - BUG: added variables for new users so they don't see an empty page.

Share this post


Link to post
8 hours ago, olehj said:

This does work flawlessly. I get disk LED activity. The second command does indeed stop the process. So there's something between JS and PHP.

 

Tested it on Firefox and Ubuntu. Nope.

 

And i THINK i know what's maybe possibly going on. I'm no coder, but bear with me.

 

Checked through the Firefox inspector, in the Network tab. When I hit that button, it simultaneously seem to do a GET request both on the cmd=killall and then issues a cmd=start command on the drive. Is it remotely possible that there's a racing condition happening here? Like the kill command being delayed, and killing the start command as it happens? Maybe network latency could cause that. I tried adding a 'sleep 2' at the begining of the smartlocate script, but that didn't seem to help. I'm a bit baffled.

 

Cheers!

 

 

 

 

Share this post


Link to post
3 minutes ago, TeeNoodle said:

This does work flawlessly. I get disk LED activity. The second command does indeed stop the process. So there's something between JS and PHP.

 

Tested it on Firefox and Ubuntu. Nope.

 

And i THINK i know what's maybe possibly going on. I'm no coder, but bear with me.

 

Checked through the Firefox inspector, in the Network tab. When I hit that button, it simultaneously seem to do a GET request both on the cmd=killall and then issues a cmd=start command on the drive. Is it remotely possible that there's a racing condition happening here? Like the kill command being delayed, and killing the start command as it happens? Maybe network latency could cause that. I tried adding a 'sleep 2' at the begining of the smartlocate script, but that didn't seem to help. I'm a bit baffled.

 

Cheers!

 

 

 

 

Did you try the new update? I have done some mods to it. For me it works the same in Win and Linux now

It does run killall before start, to be sure its not running already. It is intended. A page refresh will also kill the script.

Edited by olehj

Share this post


Link to post
1 minute ago, olehj said:

Did you try the new update? I have done some mods to it. For me it works the same in Win and Linux now

Just updated it as soon as it came in! :D

Sadly, still no dice, but let me completely remove and re-install the plugin, plus i'll clear cache and everything. Stay tuned!

 

Share this post


Link to post
6 minutes ago, olehj said:

Did you try the new update? I have done some mods to it. For me it works the same in Win and Linux now

Sadly, still no dice for me. I really wonder why it's doing that...

 

Chrome + Firefox on Windows = no dice.

 

However, i DID manage to get something out of Firefox for Linux, but. It works once. Once it's stopped again, it won't work again.. until i reload the page. Then, it works again, once. And then won't work again after stopping it again. Now, even after a page reload, it won't work anymore.

 

It's the weirdest thing.

Share this post


Link to post
18 minutes ago, TeeNoodle said:

Just updated it as soon as it came in! :D

Sadly, still no dice, but let me completely remove and re-install the plugin, plus i'll clear cache and everything. Stay tuned!

 

Can you try this file from development branch, I just added some delays to the javascript execution:

do in terminal:

 

# Download:
wget https://raw.githubusercontent.com/olehj/disklocation/devel/disklocation/pages/config.php

# Move and overwrite current config script:
mv config.php /usr/local/emhttp/plugins/disklocation/pages/config.php

You can also try to tweak the "sleep" timers at the bottom of the script, check if larger number than 200 is working better/worse.
 

Edited by olehj
  • Upvote 1

Share this post


Link to post
5 minutes ago, olehj said:

10-4! HUZZAH! WE GOT A WIN!

Tested flawlessly on Chrome x64, Firefox x64, and Firefox Linux/x64. Tried multiple drives. They all respond with a beautiful blinkage.

 

Thank you so much! Now that plugin is damn shiny!

 

Cheers!

Share this post


Link to post
6 minutes ago, TeeNoodle said:

10-4! HUZZAH! WE GOT A WIN!

Tested flawlessly on Chrome x64, Firefox x64, and Firefox Linux/x64. Tried multiple drives. They all respond with a beautiful blinkage.

 

Thank you so much! Now that plugin is damn shiny!

 

Cheers!

Sweet! Then it will be included in the next update :)

Share this post


Link to post
Just now, olehj said:

Sweet! Then it will be included in the next update

Fantastic! Thank you so much for your help! Thanks to you, now I will know in which damn tray which drive is, in case one of them fails ;)

 

I noticed it doesn't work with SSD disks, but you had warned me about it, and it's fine because it's the only SSD disk in the array, so by elimination, I know which one it is. It doesn't display the SSD temp either, but meh! I think we can all live with that ;)

 

Again, great work. You made a very useful plugin, which I think everyone will really enjoy. I know I will!

 

Cheers

Share this post


Link to post
6 minutes ago, TeeNoodle said:

Fantastic! Thank you so much for your help! Thanks to you, now I will know in which damn tray which drive is, in case one of them fails ;)

 

I noticed it doesn't work with SSD disks, but you had warned me about it, and it's fine because it's the only SSD disk in the array, so by elimination, I know which one it is. It doesn't display the SSD temp either, but meh! I think we can all live with that ;)

 

Again, great work. You made a very useful plugin, which I think everyone will really enjoy. I know I will!

 

Cheers

Ye, the SSDs can be a bit lacking when it comes to SMART information, and seems to work different with LEDs, temp works though. I have 2 identical SSDs so I need to check the serial number of the drive and hopefully have assigned the correct tray to it :P

Be aware that this SMART locate might not work on a failed/failing drive, it is mainly meant as a guide for assigning the trays for later. But who knows, the board of the HD can break as well making the HD completely inaccessible - hopefully only one drive fail at the time :P 

Edited by olehj
temp

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now