This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DBSS - Days Since Last Backup

I want to modify the above rule. We have few servers that are utilizing AAG and the database backups are happening on the secondary servers. However, we still get the alert from primary server that the databases are not getting backed up. Is there a way around this.

Thanks.

Parents
  • Hi,
    I have the same scenario.. I have implemented below code to avoid (restoring/Read only Databases)

    ---
    objs = #!DBSS_Availability_Groups_Databases where database_name=$scope.name and agent.agentID=$scope.agent.agentID#.topologyObjects
    //get the instance name
    name = scope.controller.name;
    if (name != null)
    name = name.replace("-" , "\\");

    //set a default
    role = 'NONE'
    for (obj in objs) {
    //check if the current object is from the same instance
    if (obj.controller.name.equals(name)) {
    //get the latest value from the 'role' property
    obs = server.DataService.retrieveLatestValue(obj.controller , "role");
    if (obs != null) {
    // return the role value : PRIMARY , SECONDERY
    role= obs.getValue();
    }
    }
    }

    //if not found any match return the default value
    //return role

    if(#db_status# == "Normal" && role == "PRIMARY")
    {
    condition = (#DBSS_days_since_last_backup_For_Rule# >= registry("DBSS-DatabasesDaysSinceLastBackup_Medium"));
    return Dbwc_Common_SQL_Server_IsNeedToSendAlarm(scope, "DBSS - Days Since Last Backup", "3", condition);
    } else if (#db_status# == "Normal" && role == "NONE")
    {
    condition = (#DBSS_days_since_last_backup_For_Rule# >= registry("DBSS-DatabasesDaysSinceLastBackup_Medium"));
    return Dbwc_Common_SQL_Server_IsNeedToSendAlarm(scope, "DBSS - Days Since Last Backup", "3", condition);
    }
    --
Reply
  • Hi,
    I have the same scenario.. I have implemented below code to avoid (restoring/Read only Databases)

    ---
    objs = #!DBSS_Availability_Groups_Databases where database_name=$scope.name and agent.agentID=$scope.agent.agentID#.topologyObjects
    //get the instance name
    name = scope.controller.name;
    if (name != null)
    name = name.replace("-" , "\\");

    //set a default
    role = 'NONE'
    for (obj in objs) {
    //check if the current object is from the same instance
    if (obj.controller.name.equals(name)) {
    //get the latest value from the 'role' property
    obs = server.DataService.retrieveLatestValue(obj.controller , "role");
    if (obs != null) {
    // return the role value : PRIMARY , SECONDERY
    role= obs.getValue();
    }
    }
    }

    //if not found any match return the default value
    //return role

    if(#db_status# == "Normal" && role == "PRIMARY")
    {
    condition = (#DBSS_days_since_last_backup_For_Rule# >= registry("DBSS-DatabasesDaysSinceLastBackup_Medium"));
    return Dbwc_Common_SQL_Server_IsNeedToSendAlarm(scope, "DBSS - Days Since Last Backup", "3", condition);
    } else if (#db_status# == "Normal" && role == "NONE")
    {
    condition = (#DBSS_days_since_last_backup_For_Rule# >= registry("DBSS-DatabasesDaysSinceLastBackup_Medium"));
    return Dbwc_Common_SQL_Server_IsNeedToSendAlarm(scope, "DBSS - Days Since Last Backup", "3", condition);
    }
    --
Children
No Data