Subscribe

Selecting volumes based on the percentage used

Guys,

I'm looking to have a query select volumes based off the percentage used, all volumes 90% full and up for example.  Any ideas?  I've been beating this around for a while now and getting no traction so I figured I would ask the experts.

Thanks in Advance.

Re: Selecting volumes based on the percentage used

HI Bailey,

We need to write a filter to list all the volumes based on used size. by the way are you looking for CDOT or 7-Mode. So that i can write a filter and share it with you.

Regards,

Sundar

Re: Selecting volumes based on the percentage used

7-mode, thanks Sundar!

Frequent Contributor

Re: Selecting volumes based on the percentage used

Hi,

I have attached the filter.

Import and use it.

Let me know if it works fine.

Cheers,

Anil

Re: Selecting volumes based on the percentage used

Thanks!  Can you post the code? I'm unable to upgrade to 2.2 until it goes GA so i can't use the one you attached.

Highlighted

Re: Selecting volumes based on the percentage used

Anil G left the office for the day... he will post the code in couple of hours(once he reaches home).

Re: Selecting volumes based on the percentage used

Great, thanks.

Frequent Contributor

Re: Selecting volumes based on the percentage used

Hi bailey,

This is the query i am using in the filter i created.

I was using a later version and forgot for a moment that you would not be able to import it.

SELECT

    array.ip as 'array.ip',

    volume.name as name

FROM

    storage.volume as volume,

    storage.array as array

WHERE

    (

        (

            volume.used_size_mb/volume.available_size_mb

        ) * 100

    ) > '${Percentage}'

    AND array.id = volume.array_id

    AND array.ip = '${array}'

    AND volume.name != 'vol0'

Let me know if it helps.

-Anil

Re: Selecting volumes based on the percentage used

That helps, but it doesn't appear to be doing what I want. 

When I plug in a percentage I'm not just getting volumes of that percentage used or higher but I'm not getting all of the volumes either, what am I missing here?

Frequent Contributor

Re: Selecting volumes based on the percentage used

My bad. Try this!

SELECT

    array.ip as 'array.ip',

    volume.name as name

FROM

    storage.volume as volume,

    storage.array as array

WHERE

    (

        (

            volume.used_size_mb/volume.size_mb

        ) * 100

    ) > '${Percentage}'

    AND array.id = volume.array_id

    AND array.ip = '${array}'

    AND volume.name != 'vol0'