cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 8

Need help with SWQL to limit Out of Box alert regarding snapshots

Jump to solution

Need help adjusting the Out of Box alert for VMs with Old Snapshots. We have a view environment that I do not want included for alerting.

I do not know SQL or SWQL, but it looks like I need to exclude the Cluster using vim_cluster.name value, just have no idea where or how to implement it

 

SELECT VirtualMachines.Uri, VirtualMachines.DisplayName FROM Orion.VIM.VirtualMachines AS VirtualMachines

where DayDiff(virtualmachines.OldestSnapshotDate,getdate())>14

0 Kudos
1 Solution
Level 13

SELECT VirtualMachines.Uri, VirtualMachines.DisplayName
FROM Orion.VIM.VirtualMachines AS VirtualMachines

INNER JOIN Orion.VIM.Hosts H ON VirtualMachines.Hostid=H.HostID
INNER JOIN Orion.VIM.Clusters C ON H.ClusterID=C.ClusterID
where
DayDiff(virtualmachines.OldestSnapshotDate,getdate())>14
AND C.Name <>'NameofClusterNotToInclude'

Using a SWQL custom alert on VirtualMachines. Add the bold part to the edit'able part of the query and change to your clustername.

Hope it works!

View solution in original post

0 Kudos
2 Replies
Level 13

SELECT VirtualMachines.Uri, VirtualMachines.DisplayName
FROM Orion.VIM.VirtualMachines AS VirtualMachines

INNER JOIN Orion.VIM.Hosts H ON VirtualMachines.Hostid=H.HostID
INNER JOIN Orion.VIM.Clusters C ON H.ClusterID=C.ClusterID
where
DayDiff(virtualmachines.OldestSnapshotDate,getdate())>14
AND C.Name <>'NameofClusterNotToInclude'

Using a SWQL custom alert on VirtualMachines. Add the bold part to the edit'able part of the query and change to your clustername.

Hope it works!

View solution in original post

0 Kudos

Thank you so much. Worked on the first try

0 Kudos