This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

duplicate object for logical disk

 I am running this query to search for NTFS

Select objects of type LogicalDisk from the "(Default)" datasource (of type foglight-5)
    from Root of (foglight-5:default)/HostModel/hosts/storage/logicalDisks
    where:
            (/name like "%NTFS%" And
            /queueLength/period/count greater "0")

When I try to place the information into views for names I get duplicate names. Is there a way to use Distinct function like what i have used in SQL?

  • Hello Ray,

    But Logical Disks can have the same name. What is the reason you want to do this?

    Do you just need a general List of all possible Names of Drives?

    You can also use the method ".unique{it.name}" from groovy on a list of objects.

    Jan
  • Hi Ray,

    This query returns all logical disks for all your hosts (physical, virtual).
    So suppose you have 2 hosts HostA & HostB and both have a logical drive C:\
    By running your query you will get 2 rows with the same name C:\.
    But one row will be for HostA and the other one will be for HostB.

    So it is ok to have many rows for each logical disk name (C:/, D:/ E:/ etc).
    You just need to add the host name column (yourlogicaldiskobject.host.name) in your view. This will "make" each logical disk row "unique".

    In order to understand what is going on go to script console :
    Use "LogicalDisk" and press "Do query" and you will see all your logical disk along with all related properties.

    Regards