[PLUGIN] Disk Location


Recommended Posts

Posted (edited)

Update 2024.03.07

  • Commit #296 - Added background blinking (blue) on a device during "Locate" click, if assigned.
  • Commit #290 - Changed how the background task store the SMART input to the database, collect all info before writing it instead of writing it per device as found.

Should probably not "brick" any servers out there :P GL;HF ❤️ 

Edited by FlamongOle
Link to comment
12 hours ago, FlamongOle said:

Update 2024.03.07

  • Commit #296 - Added background blinking (blue) on a device during "Locate" click, if assigned.
  • Commit #290 - Changed how the background task store the SMART input to the database, collect all info before writing it instead of writing it per device as found.

Should probably not "brick" any servers out there :P GL;HF ❤️ 

Not bricked anything but it's stuck on the below for 10 mins at least now....

 

"Extraction done. Package file disklocation.2024.03.07.zip extracted. Adding devices into database, please wait... this might take a while..."

Link to comment
2 hours ago, mikeyosm said:

Not bricked anything but it's stuck on the below for 10 mins at least now....

 

"Extraction done. Package file disklocation.2024.03.07.zip extracted. Adding devices into database, please wait... this might take a while..."

No specific reason why that should happen.. but it should list device by device as before, then when that's done it will write into the database. Nothing that really changed a lot to not make this not work like before.

 

If it's stuck for so long, take a look if the lock.db file exists in /tmp/disklocation/, if it does, delete it and check if the install continues. Might be that I should delete the temp lock file during upgrade, so I will add that now.

Link to comment

somewhere in the last week between update 2024.03.06 to now (just installed 2024.03.08), it broke my "locate" function. it flashes in the GUI as it should, but i get no blinking on the physical tray itself. i deleted all old databases and started a new one (force update all), reconfigured the locations and colors and such, and no blinking trays. it has been a long time since i setup the plugin initially cant remember how i got it to work. what am i missing? thank you for all the hard work and constant updates!

Link to comment
49 minutes ago, FlamongOle said:

No specific reason why that should happen.. but it should list device by device as before, then when that's done it will write into the database. Nothing that really changed a lot to not make this not work like before.

 

If it's stuck for so long, take a look if the lock.db file exists in /tmp/disklocation/, if it does, delete it and check if the install continues. Might be that I should delete the temp lock file during upgrade, so I will add that now.

Yes, that fixed it.

Link to comment
3 hours ago, xrichnj said:

somewhere in the last week between update 2024.03.06 to now (just installed 2024.03.08), it broke my "locate" function. it flashes in the GUI as it should, but i get no blinking on the physical tray itself. i deleted all old databases and started a new one (force update all), reconfigured the locations and colors and such, and no blinking trays. it has been a long time since i setup the plugin initially cant remember how i got it to work. what am i missing? thank you for all the hard work and constant updates!

Will be fixed next update

Link to comment

Update 2024.03.09

  • Commit #300 - ISSUE: Fixed an issue where the "Locate" button would not turn on the blinking feature on the drive LED. Also clean a bit up in the cronjob script.

300 commits and over 5 years of bugs... yey celebration 🥳

Link to comment

Update 2024.03.10

  • Commit #302 - ISSUE: Some forms relied on header("Location") to redirect after submitting a form (it's slightly faster). In case there's an error somewhere (might be anywhere in the system printing out a header), use also html meta refresh as a backup to get back to the page.
Link to comment

I don't know when this happened because I don't use Disk Location very frequently but apparently in the last month or so I think one of the updates wiped out my Disk Location configuration, i.e. all drives lost their tray IDs in Disk Location and there was a message that it needed to be configured.   I restored a database backup from February using Disk Location's "System" tab + restore button and things once again look OK again in the sense tray IDs are populated for my disk drives as they've been for many months (years?) now.    Figured I'd pipe up just in case somebody else saw something similar.

Link to comment
9 hours ago, danull said:

I don't know when this happened because I don't use Disk Location very frequently but apparently in the last month or so I think one of the updates wiped out my Disk Location configuration, i.e. all drives lost their tray IDs in Disk Location and there was a message that it needed to be configured.   I restored a database backup from February using Disk Location's "System" tab + restore button and things once again look OK again in the sense tray IDs are populated for my disk drives as they've been for many months (years?) now.    Figured I'd pipe up just in case somebody else saw something similar.

Can be caused by the database corruption that is now hopefully fixed. I can't look more into this unless I have more data on exactly when that happened. If new cases comes up with that issue, I will know if the new implementation works or not. But thanks for reporting it.

  • Like 1
Link to comment

Probably an odd request/question, Does anyone know of a way to put this program on (or know of one similar for) TrueNAS? I have this on my Unraid and I'm thinking of making a TrueNAS bare metal instead of Virtual and would love a way to have this on it, or another option would be to have TrueNAS talk to Unraid and let unraid just do a second "System" (shown below) of disks that are actually in the other machine.

 

While I'm here, how do I set the "+" or "Extra" drives to be side-by-side instead of on top of each other in the screen clip attached?

Capture.JPG

Link to comment

Was replacing an old HDD yesterday and tried using the locate button in this plugin to verify which slot the disk was installed in but never could get it to do anything obvious. I’m assuming that the button would be providing a signal via the disk activity light but never saw anything that stood out. Of course most of the lights were blinking with random activity. Exactly what should I be looking for?

Link to comment
2 hours ago, wgstarks said:

Was replacing an old HDD yesterday and tried using the locate button in this plugin to verify which slot the disk was installed in but never could get it to do anything obvious. I’m assuming that the button would be providing a signal via the disk activity light but never saw anything that stood out. Of course most of the lights were blinking with random activity. Exactly what should I be looking for?

First of all, make sure you have the newest update. Otherwise, it's not guaranteed that it will work as it depends on the drive and backbones, HBA or Raid cards etc. Even the blinking time can vary as it depends on how quickly SMART responds from the drives/devices. It can be instant, so the LED won't even turn on or blink too fast to notice (dunno how these work). SSD/NVMe won't typically work.

Link to comment
10 hours ago, Eugene D said:

Probably an odd request/question, Does anyone know of a way to put this program on (or know of one similar for) TrueNAS? I have this on my Unraid and I'm thinking of making a TrueNAS bare metal instead of Virtual and would love a way to have this on it, or another option would be to have TrueNAS talk to Unraid and let unraid just do a second "System" (shown below) of disks that are actually in the other machine.

 

While I'm here, how do I set the "+" or "Extra" drives to be side-by-side instead of on top of each other in the screen clip attached?

Capture.JPG

 

This plugin is rather dependent on Unraid as it uses variables from it. I guess the "easiest" solution is to run Unraid in a VM with all the drives accessible through it.

 

There's no real arranging of these segments, it's all just automatically CSS aligned where the browser seem to make it fit.

Link to comment
Posted (edited)

Update 2024.03.19

  • Commit #305 - IMPROVEMENT: Skip updating devices during install if database version is matching the current database version. This will make the update faster for existing install, except if the database is getting an upgrade.
  • Commit #304 - IMPROVEMENT: Prioritize using ZFS data over Unraid if it's not a traditional Unraid array. Only visible for the device and dashboard page (e.g. Device is ONLINE (ZFS) instead of ACTIVE (Unraid)). This will also use the "zfs pool" name, instead of "unraid type" which defaulted to "Cache"
Edited by FlamongOle
Link to comment
On 3/18/2024 at 11:08 AM, FlamongOle said:

First of all, make sure you have the newest update. Otherwise, it's not guaranteed that it will work as it depends on the drive and backbones, HBA or Raid cards etc. Even the blinking time can vary as it depends on how quickly SMART responds from the drives/devices. It can be instant, so the LED won't even turn on or blink too fast to notice (dunno how these work). SSD/NVMe won't typically work.

Hi,

the locate button was working and I used it before. Now after the update (i was a couple of updates behind, I dont exactly know from what version I come from) the locate button simply does not work anymore

 

In dev tools I get this error

locate_script_top.js…ins/disklocation:56 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'classList')
    at locateKillAll (locate_script_top.js…/disklocation:56:44)
    at HTMLInputElement.<anonymous> (locate_script_bottom…s?v=1710881723:25:3)
    at HTMLInputElement.dispatch (dynamix.js?v=1700087630:5:43336)
    at y.handle (dynamix.js?v=1700087630:5:41320)
locateKillAll	@	locate_script_top.js…ins/disklocation:56
(anonymous)	@	locate_script_bottom.js?v=1710881723:25
dispatch	@	dynamix.js?v=1700087630:5
y.handle	@	dynamix.js?v=1700087630:5

edit : thank you for this wonderful plugin, it's absolutly awsome! I love it!

Edited by warwolf7
Link to comment

I started this thread  as I thought it was an issue with a corrupt flash drive. It was due to 

 

boot/config/plugins/disklocation.plg  and dislklocation folder

 

The moderator suggested I remove both from the flash drive.

 

I was rebooting my Unraid server after updating the Disklocation plugin last night. I have two Unraid servers and upgraded on both, but did not reboot my other Unraid server.

 

 

 

 

 

It appears a few other's were reporting the same issue with the disklocation.plg and folder on their flash drives as well

 

Here is another user having the same issue as me.

 

 

Link to comment
11 hours ago, FlamongOle said:

Update 2024.03.20

  • Commit #307 - ISSUE: Cleaned up the javascript for the Locate functions, should hopefully work better overall now. Tested with Chromium based browsers and Firefox.

@warwolf7 you can try now with this update. Hopefully, that'll fix it.

Hi, thank you for the update. I updated but I get a similar error. 

 

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'classList')
    at locateKillAll (locate_script_top.js.php?v=1710947424&path=/plugins/disklocation:40:44)
    at HTMLInputElement.<anonymous> (locate_script_bottom.js?v=1710947424:25:3)
    at HTMLInputElement.dispatch (dynamix.js?v=1700087630:5:43336)
    at y.handle (dynamix.js?v=1700087630:5:41320)

 

I did not reboot the server to see if it would change the outcome. I'm worried about the issue raised by @Vetteman

Link to comment

I looked at the dev tool debugger

the locateKillAll function seems to remove class 'flex-container-locate' from all drives in the tray visualisator at the top

this line, "i" goes to 20. While I only have 19 allocated drive in the trays and 2not allocated drives. y= 21 but it shouldn't have to removeclass  in the drive visualisator at the top for the not allocated drives should it ?

function locateKillAll(locateDisk){
	var y = document.getElementsByClassName(locateDisk);
	var i;
	for (i = 0; i < y.length; i++) {
		y[i].value = "Locate";
		y[i].style.backgroundColor = "#F2F2F2";
		document.getElementById("bg3-" + y[i].id).classList.remove('flex-container-locate');
	}
	$.get('/plugins/disklocation/pages/locate.php',{ cmd:"killall"},function(data) {});
}

This lines fails when i==19.

document.getElementById("bg3-" + y[i].id).classList.remove('flex-container-locate');

 

 

wouldn't it be more efficient to call it like that?

using xpath

$x("//div[starts-with(@id, 'bg3-')]").forEach(el=>el.classList.remove('flex-container-locate'))


You wouldn't need to know how many are there and you would remove all of them.

 

I'm not developper, so there could be millions of reasons not to use my code that I don't know. Hopefully it helps.

Edited by warwolf7
clarification, changed assigned and unassigned drive to allocated and not allocated to avoir confusion with the plugin unassigned that we call them unassigned drives
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.