Hi Alex  Yes, I'll try   Rule definition: [IMAGE]  Only the Warning condition is enabled:  Condition // Rule: vBundle-1 VM Snap Shot Age // First - Check VM Ignore List // Second - Check VM has Active Snap // Third - Check Snapshot Age  // Read Ignore list from Registry def IgnoreList = registry("vBundle.vm.snapshot.age.ignore.list"); // Get VM Name def VMName1 = scope.get("name"); def boolean Found = false; if (IgnoreList != null) {    Found = IgnoreList.contains(VMName1);} if (Found) return false;  // Check if VM has an active snapshot if(scope.currentSnapshot == null){    return false}  // Evaluate Snapshot Age def NumOfDays = registry("vBundle.vm.snapshot.age.warning.days");  try {     creationTime= scope.currentSnapshot.get("creationTime").getTime();   if (creationTime==null) return false;   now = new Date().getTime();   diffHours = (now - creationTime)/3600000;   diffDays  = diffHours /24;   if (diffDays >= NumOfDays)    return true;   else return false} catch (Exception e) {return false;}  Alarm Message: [Warning] Virtual Machine: "[NAME]" Has a snapshot named: "[NAME]" that is older than [NAME] days. Remove old snapshots.  There are no Severity Level Variables defined.  The Action is an EmailAction:  mail.message VM ([NAME]) has a snapshot that is [NAME] Days Old  View the alarm at: [NAME]  mail.subject [Warning] VM ([NAME]) has an old Snapshot  Behavior: [IMAGE]  Rule Variables: Expression   CriticalDays  return registry ("vBundle.vm.snapshot.age.critical.days"); Expression   FatalDays     return registry ("vBundle.vm.snapshot.age.fatal.days"); Expression   SnapshotName  scope.currentSnapshot.name; Expression   VMName        return scope.get("name"); Expression   WarningDays   return registry ("vBundle.vm.snapshot.age.warning.days");   Registry Settings: vBundle.vm.snapshot.age.ignore.list [IMAGE]  vBundle.vm.snapshot.age.warning.days [IMAGE] The OOTB warning days are 7 (warning), 14 (critical) and 30 (fatal).   I hope that's all clear for you   If you want the Critical and Fatal conditions, let me know.  Brian
Hello,  I'm trying to create a rule / alarm, that firing for the snapshots when have older than X days.  I use the Topology: VMWareSnapshot.  Using an adaptation of the function for create the older snapshot report, I tried to create the rule.  creationSnapshot=scope.creationTime.getTime(); now = new Date().getTime(); diffHours = (now - creationSnapshot)/3600000; diffDays  = diffHours /24;  (diffDays>=registry("VMW:Old.Snapshot.Warning"));  When I test the condition in the script console, and in the rule condition, it works fine, but when the rule never firing.          Am I forgetting something?  Thank for any help or any ideas  Regards,  Alexander Ortiz Strategic Solutions Consultant Dell | Software Group, MCLA APM office +57 312 568 4791, mobile +57 312 568 4791email alexander.ortiz[NAME].dell.com
Create a rule / alarm for older snapshot