1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Adding Storage to Nextcloud

Discussion in 'Web Design & Development' started by EspressoBean, Mar 12, 2018.

Advertisement
  1. EspressoBean

    EspressoBean Thread Starter

    Joined:
    Feb 29, 2016
    Messages:
    232
    So Nextcloud does not show any disk usage statistics and I want to add it for my internal use, so the file that generates the server info is this:

    https://hastebin.com/isegujupuw.html

    and the StorageStatistics.php which I assume is what needs to be edited is this:

    https://hastebin.com/enedatobug.php

    and I added this code:

    PHP:
        public function getDiskInfo() {
            return [
                
    'total_space' disk_total_space("/"),
                 
    'free_space'disk_free_space("/"),
                
    'used_space' = ($total_space $free_space),
            ];
        }
    Making it:

    https://hastebin.com/cagunoqaju.php

    But I do not really like doing it this way and wanted to see if anyone can recommend a better way of executing this, preferably in its own file where I can also figure out the environment, between Linux and Windows.
     
  2. Sponsor

  3. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,110
    I've had a quick look at the problem and discovered that you can get disk usage stats ...
    If you set your space to limited for example 2tb it will show you there how much is left. You can do that on admins account in users settings.
    I got that from this link - hope it helps ...
     
  4. EspressoBean

    EspressoBean Thread Starter

    Joined:
    Feb 29, 2016
    Messages:
    232
    Saw that before but it didn't really answer the issue I am having.
     
  5. EspressoBean

    EspressoBean Thread Starter

    Joined:
    Feb 29, 2016
    Messages:
    232
  6. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,110
    Right at the bottom of your nextcloud script https://hastebin.com/isegujupuw.html you have this div:
    HTML:
    <div class="section" id="ocsEndPoint">
        <h2><?php p($l->t('External monitoring tool'));?></h2>
        <p>
            <?php p($l->t('You can connect an external monitoring tool by using this end point: ') . $_['ocs']);?>
    </div>
    Which is where I think you should be placing your summary, but quite frankly this is just a shot in the dark.

    In your position, I would have posed this question, where you are more likely to receive expert help - in their Community Forum
    I recommend you sign up there and give it a go ...
     
  7. JiminSA

    JiminSA

    Joined:
    Dec 15, 2011
    Messages:
    3,110
    @EspressoBean, did you do as I suggested? If so, did you get an answer?
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Short URL to this thread: https://techguy.org/1206598