Jump to content

New Plugin - Disk Space


chef

Recommended Posts

Dibbes

Thank you for taking the time to help test that out.

 

I learned a lot from do this project.

 

Now I'm wondering about running bash scripts from command prompts in .netcore.

 

It's a whole new world

 

@@chef, for the Windows version of this plugin, is there a way to get the name of the disks displayed as well, next to the drive-letter? I have a ton of shares mapped to my server and I don't always remember which is which.

  • Like 1
Link to comment
Share on other sites

@@chef, for the Windows version of this plugin, is there a way to get the name of the disks displayed as well, next to the drive-letter? I have a ton of shares mapped to my server and I don't always remember which is which.

Yes, I'll add this.

  • Like 1
Link to comment
Share on other sites

@Dibbles It's been added, at the bottom beside space info. Is that cool?

Edited by chef
  • Like 1
Link to comment
Share on other sites

Dibbes

@Dibbles It's been added, at the bottom beside space info. Is that cool?

 

Perfect! and exactly how I pictured it  :) 

 

Thank you 

Link to comment
Share on other sites

Dibbes

@@chef Some observations :)

 

  • Not sure why and it's honestly not really important, but for some drives the names aren't displayed (T & U drives)... very strange. These are Windows Shares, so maybe it's that...
  • Also, for some shares the names are not displayed completely, just the first word (P & R Drives), These are different Synology boxes
  • And, lastly, purely cosmetic, the boxes are not uniform in size

And something I have not been able to figure out, how do I change colours of the images? I've seen various screenshots in this threat with different colours than mine... Any reason for that?

 

Love this plugin though! Thanks

 

5e2034117d58a_harddrives.jpg

Edited by Dibbes
Link to comment
Share on other sites

@Dibbles

 

This is great feedback, thank you.

 

Color is changed by selecting the Used/Available boxes at the top of the card.

 

Interesting that the Volume label doesn't show of those two drives specifically.   What does windows report as the volume label for those drives?

 

 

Can you tell me which drive card in the image you posted has the odd sizing problem? I can fix sizing with some css.

Edited by chef
Link to comment
Share on other sites

Dibbes

@Dibbles - You're going to have to drop the "l" from my handle, otherwise I don't get the notification... lol

 

 

Interesting that the Volume label doesn't show of those two drives specifically.   What does windows report as the volume label for those drives? - Sure, see below

 

 

Can you tell me which drive card in the image you posted has the odd sizing problem? I can fix sizing with some css. - it's not much, but you can see it in the screenshot

 

5e205efd82736_devicesdrives.jpg

  • Like 1
Link to comment
Share on other sites

Oh geez, I finally got your name right... I must be getting old lol. Or need better glasses. Lol

 

I see why those shares are not showing properly. I can fix the code to make them show up.

  • Like 1
Link to comment
Share on other sites

Dibbes

@@chef one more thing, can the used and available be swapped? Currently the available in the pie/circle (I don't know how it's called, really, but I mean the graphical part) comes first. I think that counter intuitive, as most OS'es give used first... (Also the legend gives used first, by the way)

Link to comment
Share on other sites

rbjtech

I see why those shares are not showing properly. I can fix the code to make them show up.

 

Hi Chef, great plugin but as all of my media is on UNC paths (\\server\media etc) on a remote server/nas, the plugin is currently only showing the system drive for me which is of limited use.

 

Do you plan to add UNC support ?

 

Thanks for your efforts - this could be incorporated under the main 'Server | Libraries' Admin View - as there is room there to display it ?  Nice.

 

Edit - a crude mock up ..

 

5e217eb2d0e3d_diskspace.png

Edited by rbjtech
Link to comment
Share on other sites

Happy2Play

From a Network Shares aspect, maybe a manual input to show that share.

 

And a option to not show/hide specific drives.

  • Like 1
Link to comment
Share on other sites

Do you mean there should be a dialog with all the mounts, shares and drives available, and put checkboxes beside them to choose which ones to display?

 

 

That would be pretty easy to do.

 

 

But do the UNC drives show up in the API? We can only display paths that show up in IFileSystem (EnvironmentService).

Link to comment
Share on other sites

Happy2Play

Do you mean there should be a dialog with all the mounts, shares and drives available, and put checkboxes beside them to choose which ones to display?

 

 

That would be pretty easy to do.

 

 

But do the UNC drives show up in the API? We can only display paths that show up in IFileSystem (EnvironmentService).

Don't really know anything about this, but if a user could select/deselect the drives they wish to monitor, should cover the intended usage of this plugin.

 

For the Network Shares I would think they would need to manually enter the shares they would want to monitor, as they typically would not be local to the machine Emby is on.

Link to comment
Share on other sites

Don't really know anything about this, but if a user could select/deselect the drives they wish to monitor, should cover the intended usage of this plugin.

 

For the Network Shares I would think they would need to manually enter the shares they would want to monitor, as they typically would not be local to the machine Emby is on.

 

 

Yep, right away I can see some issues coding network shares into this thing.  Users gonna have to add these extra.

 

There is a chance that we can't read Disk information of the share directory because it isn't local.

 

Not sure how this is going to go.

  • Like 2
Link to comment
Share on other sites

I have UNC paths working in Windows, but I don't know how to do it under UNIX... ... yet.

 

Currently I can check for the OS like this:

        private static bool IsUnix()
        {
            var isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
                         RuntimeInformation.IsOSPlatform(OSPlatform.Linux);

            return isUnix;
        }

This is super helpful code built into CORE. That means I can code around those two platforms. 

 

I can Marshal in un-managed code from PInvoke on windows to access UNC shares like this:

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
        private static extern bool GetDiskFreeSpaceEx(string lpDirectoryName, out ulong lpFreeBytesAvailable, out ulong lpTotalNumberOfBytes, out ulong lpTotalNumberOfFreeBytes);

and have it only run on windows machines to return UNC drive data.

 

that's sweet!

 

 

But, to grab UNIX data it will probably mean using a Bash script and parsing the StdOut information.

 

I don't want to add this stuff to a release of the plugin until I know it can stay cross platform and has been thoroughly tested.

 

So... any Linux guys out there who know a good bash script to grab UNC disk information?? 

Edited by chef
  • Like 1
Link to comment
Share on other sites

CBers

I have UNC paths working in Windows, but I don't know how to do it under UNIX... ... yet.

 

Currently I can check for the OS like this:

        private static bool IsUnix()
        {
            var isUnix = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
                         RuntimeInformation.IsOSPlatform(OSPlatform.Linux);

            return isUnix;
        }

This is super helpful code built into CORE. That means I can code around those two platforms. 

 

I can Marshal in un-managed code from PInvoke on windows to access UNC shares like this:

        [return: MarshalAs(UnmanagedType.Bool)]
        [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
        private static extern bool GetDiskFreeSpaceEx(string lpDirectoryName, out ulong lpFreeBytesAvailable, out ulong lpTotalNumberOfBytes, out ulong lpTotalNumberOfFreeBytes);

and have it only run on windows machines to return UNC drive data.

 

that's sweet!

 

 

But, to grab UNIX data it will probably mean using a Bash script and parsing the StdOut information.

 

I don't want to add this stuff to a release of the plugin until I know it can stay cross platform and has been thoroughly tested.

 

So... any Linux guys out there who know a good bash script to grab UNC disk information?? 

 

Wouldn't they just be mounted filesystems under unix, using the df command ?

 

Does your plugin send notifications if a particular disk is below a certain threshold ?

Link to comment
Share on other sites

CBers

@@chef

 

Not sure how the AVAILABLE and USED figures are calculated that are displayed if you hover over the images, but they don't look good.

 

5e2efcf46c6f0_EmbyDiskSpace1.jpg 5e2efd0480eba_EmbyDiskSpace2.jpg

 

Just installed the plugin via the catalog.

Link to comment
Share on other sites

You can change the color by clicking on the little square.

 

Those numbers are bytes. Does that make sense?

 

It was the built in way to calculate the graphs.

 

Maybe I can change it to read something more readable. It's calculated on the bottom though.

 

Should I try?

Edited by chef
Link to comment
Share on other sites

And yes it should send notifications of full drives!

 

Great idea, @@CBers what kind of notifications do you want to see?

 

On the dashboard under alerts maybe? Or dashboard alert modals?

Link to comment
Share on other sites

CBers

You can change the color by clicking on the little square.

 

Those numbers are bytes. Does that make sense?

 

Not worried about the colour, but the figures are meaningless.

 

No-one is going to sit there working out what 1424142395248 in bytes is in Tb/Gb/Mb etc..

 

Wouldn't it be better to show the information in the same format as the size of the drive at the bottom ?

Link to comment
Share on other sites

CBers

And yes it should send notifications of full drives!

 

Great idea, @@CBers what kind of notifications do you want to see?

 

On the dashboard under alerts maybe? Or dashboard alert modals?

 

It was mentioned in this thread about having a notification if a drive runs out of space, especially if it's used for recording Live TV (DVR).

  • Like 1
Link to comment
Share on other sites

Not worried about the colour, but the figures are meaningless.

 

No-one is going to sit there working out what 1424142395248 in bytes is in Tb/Gb/Mb etc..

 

Wouldn't it be better to show the information in the same format as the size of the drive at the bottom ?

I will use my calculator function to change them to a more compressed number. But I'm not sure it will show units, I'll try.

  • Like 1
Link to comment
Share on other sites

It was mentioned in this thread about having a notification if a drive runs out of space, especially if it's used for recording Live TV (DVR).

Consider it done.

  • Like 2
Link to comment
Share on other sites

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
×
×
  • Create New...