SWQL Help In Alert

HI

I'm new to SWQL and SQL. I want to modify an out of box alert that has a SWQL Trigger. This alert fires when Snapshots are older than 90 days. I want to filter it to a subset of servers with a particular name. There are only 2 statements in my Trigger Condition. Together the statements do not validate. But if I test them independently they will both validate.

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

where DayDiff(virtualmachines.OldestSnapshotDate,getdate())>90;

Where VirtualMachines.DisplayName LIKE 'ajsfdev*'

So basically this trigger should fire when a snapshot is over 90 days and if the Displayname starts with "ajsfdev"

Any help would be appreciated.

Thanks

Rick 

Top Replies

  • , your where statement should be an AND statement instead of another where. Like below

    where DayDiff(virtualmachines.OldestSnapshotDate,getdate())>90 AND VirtualMachines.DisplayName LIKE 'ajsfdev…