This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Alerting using SWIS variables - The Datastore Story

So I have built a couple of datastore alerts in the Orion alerting engine.  I won't bore you with the technical details of the alert logic, etc. because it doesn't really matter.  My issue is with using SWIS variable references and having them not render in the output.

Here is a portion of the notification entry:

Datastore total latency for ${N=SwisEntity;M=Name} in ${N=SwisEntity;M=Clusters.Name} on ${N=SwisEntity;M=DataCenter.VCenter.Name} is ${LatencyTotal} ms

As you can see the SwisEntity is a datastore.  What I want to do is to display the Cluster name and the vCenter that manages the hosts in that cluster to make it easier for our vCore team to find the offending datastore. (We have lots of vCenters and some of them share cluster names)  However, even those SWQL studio shows that Orion.VIM.Datastores is connected to Orion.VIM.Clusters via a named link 'Clusters' that reference ${N=SwisEntity;M=Clusters.Name} doesn't resolve to the cluster name.

And, just because I am a glutton for punishment, I tried to follow the table links from Orion.VIM.Datastores all the way back to Orion.VIM.VCenters using ${N=SwisEntity;M=DataCenter.VCenter.Name}.

My questions are two-fold:

1)  Why isn't my cluster reference working even though I can see the linked table reference in the Orion.VIM.Datastores table?

2)  Can I follow linked tables across multiple links to go from datastores to clusters to datacenters to vCenters to get the vCenter name?  If so, what am I missing in my variable?

Parents
  • Hi, it looks like virtualization alert macros have some issues with navigable properties. You can use custom SWQL macro as a workaround, for example following will get you the cluster name:

    ${N=SWQL;M=SELECT TOP 1 d.Clusters.DisplayName FROM Orion.VIM.Datastores d WHERE DataStoreID=${N=SwisEntity;M=DataStoreID} }

Reply
  • Hi, it looks like virtualization alert macros have some issues with navigable properties. You can use custom SWQL macro as a workaround, for example following will get you the cluster name:

    ${N=SWQL;M=SELECT TOP 1 d.Clusters.DisplayName FROM Orion.VIM.Datastores d WHERE DataStoreID=${N=SwisEntity;M=DataStoreID} }

Children
  • Thanks Lukas. Do you need me to open a ticket for this or is it already added as a bug?

  • Hey Lukas, I tried to get that custom SWQL macro to work but it would not render into a value.  I ended up falling back to a SQL custom value for both the cluster and vCenter name.  I did notice that the alerting engine only says 'Insert custom SQL' not 'SWQL' -- is that an NPM 12 feature?

  • I have this same issue trying to get the hostname for the datastore. I'm trying to use this SWQL variable 

    ${N=SWQL;M=SELECT DS.Hosts.Node.NodeName FROM Orion.VIM.Datastores DS where DS.datastoreid = ${DataStoreID}}
    and all it returns is ${N=SWQL;M=SELECT DS.Hosts.Node.NodeName FROM Orion.VIM.Datastores DS where DS.datastoreid = 3247}. I can run it in SWQL studio and I get the host name so I know it works and I have done other variables of this type so I'm stumped