Forum Discussion

Beeswing's avatar
Beeswing
New Contributor III
4 years ago

How to check disk space

Hi,

I've had a dig around, but I can't seem to find it.  Anyone know where I can see the disk space utilisation?

We've set up a number of new apps in our environment recently, and I'm concerned we might be running out of space.

20 Replies

  • Sandy2024's avatar
    Sandy2024
    New Contributor

    I tried this solution, and it works perfectly for an application. It would show the size details for that specific app which is open. I am just wondering if it's possible to make this rule work for Environment level?

    • Spalomino's avatar
      Spalomino
      New Contributor III

      Sandy:  I am sure that is possible.  We would just need to find the SQL stored command that would provide that information.  I'll look around and see what I can find.

  • Spalomino's avatar
    Spalomino
    New Contributor III

    Sandy:  The output of the code shows up in the System>Error Log.  You will see two lines one for unallocated space, the other for database_size.  

    T_Kress:  Thanks for sharing.  I did download that application, but I couldn't get it to run on my version of 8.5.  That is why I went the code direction.

    Thanks,

    SP

  • T_Kress's avatar
    T_Kress
    Valued Contributor

    The system diagnostics dashboard has that info here:

     

  • Spalomino's avatar
    Spalomino
    New Contributor III

    Mark:  I hope you don't mind.  I add the full code.  For those like me who struggle with VB.  :)

    Imports System
    Imports System.Collections.Generic
    Imports System.Data
    Imports System.Data.Common
    Imports System.Globalization
    Imports System.IO
    Imports System.Linq
    Imports Microsoft.VisualBasic
    Imports OneStream.Finance.Database
    Imports OneStream.Finance.Engine
    Imports OneStream.Shared.Common
    Imports OneStream.Shared.Database
    Imports OneStream.Shared.Engine
    Imports OneStream.Shared.Wcf
    Imports OneStream.Stage.Database
    Imports OneStream.Stage.Engine
     
    Namespace OneStream.BusinessRule.Extender.SJP_GIGChk 'Your Extensibility Rule must be the same name.
    Public Class MainClass
    Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
    Try
    'Hi, you can check an individual database size With an extensibility rule containing code Like this:
     
    Dim sql As String = "EXEC sp_spaceused;"
    Dim dbConnApp As DbConnInfoApp = brapi.Database.CreateApplicationDbConnInfo(si)
     
    Using dbConnApp
    Using dt As DataTable = BRAPi.Database.ExecuteSql(dbConnApp, sql.ToString, True)
    If Not dt Is Nothing Then
    'Reference dt to access data table results
    For Each dr As DataRow In dt.Rows
    'Process rows
    brapi.ErrorLog.LogMessage(si, "database_size: " + dr("database_size"))
    brapi.ErrorLog.LogMessage(si, "unallocated space: " + dr("unallocated space"))
    Next
     
    End If
    End Using
    End Using
     
    Return Nothing
    Catch ex As Exception
    Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
    End Try
    End Function
    End Class
    End Namespace
     
     
    • Sandy2024's avatar
      Sandy2024
      New Contributor

      Hi Spalomino

      Thanks for providing this solution. I have a question, where i would see the results after running this business, Rule?

      Thank you 

      Sandy

       

  • MarkMatson's avatar
    MarkMatson
    New Contributor III

    Hi, you can check an individual database size with an extensibility rule containing code like this:

    Dim sql As String = "EXEC sp_spaceused;"
    Dim dbConnApp As DbConnInfoApp = brapi.Database.CreateApplicationDbConnInfo(si)

    Using dbConnApp
    Using dt As DataTable = BRAPi.Database.ExecuteSql(dbConnApp, sql.ToString, True)
    If Not dt Is Nothing Then
    'Reference dt to access data table results
    For Each dr As DataRow In dt.Rows
    'Process rows
    brapi.ErrorLog.LogMessage(si, "database_size: " + dr("database_size"))
    brapi.ErrorLog.LogMessage(si, "unallocated space: " + dr("unallocated space"))
    Next

    End If
    End Using
    End Using

  • NicoleBruno's avatar
    NicoleBruno
    Valued Contributor

    Hello! 
    We're on the cloud and this is how we review our application space: 

    Bottom right corner of the dashboard lists the GB used by application in the environment where you've originated the dashboard (ie. DEV or PROD environments). Hope that's useful! 

     

    • Beeswing's avatar
      Beeswing
      New Contributor III

      Hi..  I know it's been a while, but hoping you could provide some more info.  
      I don't have the Database Statistics Dashboard that you mentioned, and I can't find it on the market place.  Is this one you created yourself?  Or is it indeed from something in the market place?

       

      Thanks

      • NicoleBruno's avatar
        NicoleBruno
        Valued Contributor

        Hi, 

        It's not a marketplace tool. Can you try searching your dashboards for "storage chart" and see if it's there?

        I assume it's out of the box OS as we didn't create it. If you can't find it, I'd suggest contacting your OS customer success/account manager or maybe submitting a OS support ticket for more direction. 

  • NicolasArgente's avatar
    NicolasArgente
    Valued Contributor

    Hi Beeswing,
    I do not think you can find this directly and the reason behind is that the space increases automatically on Azure elastic pools. I think you could have a look under System > Environement>OS DB Server and do a filter on ElasticPoolStorageMB. That is the closest thing i can help with.

    Please give a kudo if it helps 🙂