In order to provide more information in the Alert Message for a Volume breaching a threshold I've added a SQL query that uses a Join to pull the Name of the VServer (NetApp) hosting the Volume (bolded below.) This works great when the Volume in question is indeed being hosted under a NetApp Cluster VServer. If the Volume is on a NetApp 7-mode I see the SQL query text after the "VServer: " label. I would like to use some logic that will only list the VServer when applicable.
I know it is preferred by Solarwinds that we use SWQL/SWIS because any queries or logic used there should survive product updates. So my questions;
- How could the query below be re-written in SWQL/SWIS?
- Can I use the "IsNull" or "Case" function to only display the VServer if it is applicable?
Thanks!
## Alert Message Excerpt Below ##
Timestamp: ${N=Alerting;M=AlertTriggerTime;F=DateTime}.
Array: ${SQL: SELECT a.Name
FROM dbo.[SRM_StorageArrays] a
WHERE a.StorageArrayID = ${N=SwisEntity;M=StorageArrayID;F=OriginalValue} }
VServer: ${SQL: SELECT svm.Name
FROM dbo.[SRM_VServers] svm
INNER JOIN dbo.[SRM_VServerToVolumesMapping] m
ON svm.VServerID = m.VServerID
WHERE m.VolumeID = ${N=SwisEntity;M=VolumeID}}
Volume ${N=SwisEntity;M=Name} has only ${N=SwisEntity;M=CapacityFreePercentage} (${N=SwisEntity;M=CapacityFree}) free