Delphix Toolkits (dxToolkit and dxmToolkit)

 View Only
  • 1.  Script to list VDB's that are disabled or stopped.

    Posted 04-03-2023 05:41:00 AM
    Edited by Philip McDonald 04-03-2023 05:44:58 AM

    Hi,

    Can anybody please help with the following request?

    As part of our morning checks, we need to schedule a report to identify when a VDB has become disabled or has stopped.<o:p></o:p>

    Is there any script/report that you can provide that does this?

    #dxToolkit #dxmToolkit #vdb #reporting #scripts 

    ------------------------------
    Philip McDonald
    Delphix Community Members
    ------------------------------



  • 2.  RE: Script to list VDB's that are disabled or stopped.

    Posted 04-03-2023 02:01:00 PM

    Hello,
    I think this command might be what you are looking for:

     % ./dx_get_db_env  -engine neal6017 -type VDB

    Appliance            Hostname             Database                       Group           Type     SourceDB                       Parent snapshot                     Used(GB)   Status     Enabled    Unique Name                    Parent time                         VDB creation time                   VDB refresh time                    

    -------------------- -------------------- ------------------------------ --------------- -------- ------------------------------ ----------------------------------- ---------- ---------- ---------- ------------------------------ ----------------------------------- ----------------------------------- ----------------------------------- 

    neal6017             nealrh83.dcol2.delph Vbigdb                         ASE             VDB      bigdb                          2023-02-10 16:07:33 EST             0.01       INACTIVE   enabled    N/A                            2023-02-10 16:07:33 EST             2023-02-08 08:17:58                 2023-02-14 13:43:10                 

    neal6017             nealrh83.dcol2.delph Vbigdb2                        ASE             VDB      bigdb                          2023-02-23 13:39:24 EST             0.02       RUNNING    enabled    N/A                            2023-02-23 13:39:24 EST             2023-02-24 08:30:29                 2023-02-24 08:30:29                 

    neal6017             nealwin2019.dcol2.de VMcLaren                       MSSQL           VDB      McLaren                        2023-03-27 14:56:31 PDT             N/A        UNKNOWN    enabled    N/A                            2023-03-27 14:56:31 PDT             2023-04-03 12:56:53                 2023-04-03 12:56:54  



    ------------------------------
    Neal Stack
    Senior Principal Technical Support Engineer
    Delphix
    ------------------------------



  • 3.  RE: Script to list VDB's that are disabled or stopped.

    Posted 04-04-2023 03:22:00 AM

    Thanks. It works but it is also generating these messages:

    ./dx_get_db_env  -engine enginetest -type VDB
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.
    Use of uninitialized value in string eq at /tmp/par-64656c70686971/cache-c99e3cf7ba5d6d0217b813df6582985efa1a3bb5/inc/lib/Engine.pm line 1059.



    ------------------------------
    Philip McDonald
    Database Administrator
    Delphix Community Members
    ------------------------------



  • 4.  RE: Script to list VDB's that are disabled or stopped.

    Posted 04-04-2023 09:16:00 AM

    Hello Philip,

    I see two dxtoolkit bugs with that error mentioned ( https://github.com/delphix/dxtoolkit/issues/104 and https://github.com/delphix/dxtoolkit/issues/185 ). Depending on the version of dxtoolkit you are using and the version of Delphix you are connecting to might trigger one of these.

    I would make sure you are on the latest version of dxtoolkit and if you still experience the error, report it will as much details as you can:
    * https://github.com/delphix/dxtoolkit/issues

    Thanks,
    Neal



    ------------------------------
    Neal Stack
    Senior Principal Technical Support Engineer
    Delphix
    ------------------------------



  • 5.  RE: Script to list VDB's that are disabled or stopped.

    Posted 04-04-2023 09:10:00 AM

    Hi, 

    you  can get dataset status with an API  call.

    try{
        $GetDBs = $(Invoke-RestMethod  -Method Get -ContentType application/json -WebSession $api_cookie  -Uri "https://${ENGINE}/resources/json/delphix/source" )
    }catch{
         $script:mailbody=$mailbody+"<tr> <td>$($engine.toupper())</td> <td colspan=3 > Get source list failed with `"$($_)`"</td></tr>" 
    }
    try{
        $getdatabase = $(Invoke-RestMethod  -Method Get -ContentType application/json -WebSession $api_cookie  -Uri "https://${ENGINE}/resources/json/delphix/database" )
    }catch{
        $script:mailbody=$mailbody+"<tr> <td>$($engine.toupper())</td> <td colspan=3 >Get database list failed with `"$($_)`"</td></tr>"
    }
    $NoRunningVDBs = $($GetDBs.result | where { $_.runtime.status -ne "RUNNING" -and $_.namespace -eq $null  } | Select-Object)



    ------------------------------
    Vijayender Singidi
    ------------------------------



  • 6.  RE: Script to list VDB's that are disabled or stopped.

    Posted 04-04-2023 02:13:00 PM

    You can try POSTMAN or CURL. GET https://${ENGINE}/resources/json/delphix/source

    JSON result search "runtime.status" (Examples RUNNING, UNKNOWN)



    ------------------------------
    Joel Zulueta
    IT Automation Developer
    Allstate Insurance Company
    ------------------------------