Skip to Main Content
Liongard Library

Welcome to Liongard Library, where Lions share! This is a community-led space where Liongard users can come to teach and learn from one another.
Share custom Metrics, get inspired and see what’s trending in the Pride.

Pride Etiquette:
➕ Have great custom Metrics? Add them as entries!
🌟 Want to use a Metric? Copy the query and
follow this doc.
👍 Tried a Metric from the Library? Like it!
📣 Have a question or feedback on a Metric? Add a comment!
🔎 Not sure where to start? Learn about Metrics and how to write them.
💬 Need help writing a metric or want to help support others? Join the conversation in our Liongard Lounge #metrics slack channel.

🥴 See something off? Open a support chat to let us know.

Categories VMware vCenter
Created by Stephen Rankich
Created on May 5, 2022

VMware vCenter: Datastores Percentage Of Drive Used

Using new roarpath function get the datatstores percentage of drive used list


vCenterDatastores[].[name, percent_of(to_number(capacity_r), to_number(free_space_r))]

  • Attach files
  • Bill Krauss (Applied Tech)
    Aug 16, 2022

    I'm getting the output of
    [ [ "Volume1", 398.06 ], [ "Volume2", 996.53 ], [ "Volume3", 444.61 ], [ "Volume4", 114.61 ] ]

    Something is not working... I didn't know we could get more than 100%.

    Here is a snip of the dataprint.

    vCenterDatastores: Array(4)

    0: Object

    datastore: "datastore-11"

    name: "Volume1"

    type: "VMFS"

    free_space: 1129492512768

    capacity: 4496025452544

    free_space_r: "1051.922"

    capacity_r: "4187.250"

    1: Object

    datastore: "datastore-114"

    name: "Volume2"

    type: "VMFS"

    free_space: 6618806747136

    capacity: 65958349635584

    free_space_r: "6164.244"

    capacity_r: "61428.500"

    2: Object

    datastore: "datastore-12"

    name: "Volume3"

    type: "VMFS"

    free_space: 999874887680

    capacity: 4445559586816

    free_space_r: "931.206"

    capacity_r: "4140.250"

    3: Object

    datastore: "datastore-36153"

    name: "Volume4"

    type: "VMFS"

    free_space: 254602641408

    capacity: 291789340672

    free_space_r: "237.117"

    capacity_r: "271.750"