Foglight

Create a rule / alarm for older snapshot

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 4791
email alexander.ortiz@software.dell.com

Parents
No Data
Reply
  • Hi,

    its a pity that this Rule is gone in newer versions of Foglight.

    Based on the information offered here, I have created a new condition that can be used in a Rule.

    Condition:

    // Evaluate Snapshot Age
    def NumOfDays = registry("VMW:SnapshotAging");

    creationTime=scope.currentSnapshot;
    if (creationTime==null)
    return false;
    getcreationTime=scope.currentSnapshot.get("creationTime").getTime();
    now = new Date().getTime();
    diffHours = (now - getcreationTime)/3600000;
    diffDays = diffHours /24;
    if (diffDays >= NumOfDays)
    return true;
    else
    return false;

    I hope you will find this useful.

    Regards,
Children
No Data