0 Replies Latest reply on Sep 5, 2019 10:23 AM by sxnxr

    Supermetric preview working. Does not work on the object vrops 7.5

    sxnxr Expert
    vExpert

      Apologises for the length.

       

      I am trying top create a dashboard that shows me how many sockets are in clusters for a given vcenter. Part of this is i want to do the same but only the clusters in the vcenter that has vsan enabled. It is a list of all the vcenters and two colum. The first is the total sockets in the vcenter and the second is the total sockets in vsan clusters in that vcenter

       

      This is to help track licence use. The first part is easy with a supermentric counting the socket property. The vsan one is not working as expected.

       

      The problem is that the property value for a host with vsan enabled is a string value "Enabled" I cant use that in an if supermetric as it needs to be values. the only way i can use the string value is with a where condition

       

      eg from the docs

       

      ${this, metric=summary|runtime|isIdle, where = "System Properties|resource_kind_type !contains GENERAL"}

       

      This will show me the is idle metric if the system property resource kind does not contain the text string GENERAL

       

      For me to use an if statement i need a value so i created an SM with the number 100 in it. I then created the above where statement

       

      ${this, metric=Super Metric|sm_f5fa94bb-9b29-4ae4-9a34-ad918214e526, where = "Config|vsanEnabled contains Enabled"}

       

      What this should do is return the value 100 where vsan enabled property contains Enabled and not return anything if it does not contain Enabled.

       

      I preview this against a host that has vsan enabled i get

       

      I run it on a host that does not have vsan enabled i get

       

      If i wanted to wrap this up into an if statement so it returns 0 if it is not enabled i can with  ${this, metric=Super Metric|sm_f5fa94bb-9b29-4ae4-9a34-ad918214e526, where = "config|vsanEnabled contains Enabled"}==100?100:0

       

       

      At this point i am all happy because i can now do an if statement to count all the sockets in the hosts that just have vsan enables so i can track my licence usage. So i thought.

       

      If i add and enable all the SMs and look at the same objects in inventory i get both returning 100. The top one in the below is the same object i previewed that does not have vsan enabled.

       

       

      Any idea what is happening and why the preview works but the object does not