[PLUGIN] Disk Location


Recommended Posts

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
Link to comment
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!

Link to comment
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!

 

Link to comment
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
Link to comment
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

Link to comment

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.

 

Link to comment
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.

Link to comment
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.

Link to comment
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.

 

Link to comment
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

Link to comment
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.

Link to comment

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.

Link to comment
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!

 

 

 

 

Link to comment
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
Link to comment
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!

 

Link to comment
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.

Link to comment
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
Link to comment
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!

Link to comment
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 :)

Link to comment
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

Link to comment
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
Link to comment
3 minutes ago, olehj said:

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

Then this is a bit weird:

1:0:6:0 0000000000000000 ADATA SU655 2I4220072140 480.1GB SSD 2.5 inches

Are SSDs lacking Logical Unit Numbers for a reason?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.