Skip to content

Conversation

jmiguelhp
Copy link
Contributor

Current Fabric Monitoring Data Model only accept the configuration of name. Support for destination_group was added and sopport of user-defined fabric monitoring policies.

These are non-breaking changes.

Data tested:

---
apic:
  fabric_policies:
    monitoring:
      snmp_traps:
        - name: trap1
          destination_group: mon_snmp1_dst_grp
        - name: trap2
      syslogs:
        - name: syslog1
          description: desc1
          session: true
          minimum_severity: debugging
          admin_state: false
          format: nxos
          show_millisecond: false
          show_timezone: false
          local_admin_state: false
          local_severity: emergencies
          console_admin_state: false
          console_severity: alerts
          destination_group: mon_syslog1_dst_grp
        - name: syslog2
      policies:
        - name: Custom_Policy1
          description: This is a custom policy for policy monitoring.
          fault_severity_policies:
            - class: snmpClient
              faults:
                - fault_id: F1368
                  description: "Fault 1368 nice description"
                  initial_severity: critical
                  target_severity: inherit
            - class: snmpConfIssues
            - class: snmpTrapDest
              faults:
                - fault_id: F1450
                  description: "Fault 1450 cool description"
                - fault_id: F1449
                  description: "Fault 1449 superb description"
                  initial_severity: minor
                  target_severity: critical
          snmp_traps:
            - name: policy_trap1
              destination_group: pol_snmp_dst_grp
            - name: policy_trap2
          syslogs:
            - name: policy_syslog1
              description: desc1
              session: true
              minimum_severity: debugging
              admin_state: false
              format: nxos
              show_millisecond: false
              show_timezone: false
              local_admin_state: false
              local_severity: emergencies
              console_admin_state: false
              console_severity: alerts
              destination_group: pol_syslog_dst_grp
            - name: policy_syslog2
        - name: Custom_Policy2

@ogorczow ogorczow self-requested a review July 23, 2025 11:32
@ogorczow
Copy link
Contributor

I guess this example data is vague?

          syslogs:
            - name: policy_syslog1
              description: desc1
              session: true
              minimum_severity: debugging
              admin_state: false
              format: nxos
              show_millisecond: false
              show_timezone: false
              local_admin_state: false
              local_severity: emergencies
              console_admin_state: false
              console_severity: alerts
              destination_group: pol_syslog_dst_grp

}]
}

module "aci_monitoring_policy" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe lets call it aci_monitoring_policy_common and 2nd module just aci_monitoring_policy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and lets add there fault severity policies (for common object), to keep all modules supporting the same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way, i guess there is not an option to configure new syslog destination or snmp destination without adding it to common object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe lets call it aci_monitoring_policy_common and 2nd module just aci_monitoring_policy?

We can check this with Justyna. I tried to keep it the way it is in order to ensure backwards compatibility.

and lets add there fault severity policies (for common object), to keep all modules supporting the same

As per my tests, common policy does not allow changes in Fault severities.

by the way, i guess there is not an option to configure new syslog destination or snmp destination without adding it to common object?

Not sure about this one. Hope you can elaborate it

@ogorczow
Copy link
Contributor

ogorczow commented Jul 25, 2025

If we analyze common policy, i guess that there was 1 more broken thing:

---
apic:
  fabric_policies:
    monitoring:
      snmp_traps:
        - name: trap1
          destination_group: mon_snmp1_dst_grp

If we consider that we create an SNMP destination named "trap1" and also it automatically creates under monitoring common policy reference, in our case it will generate reference to 'mon_snmp1_dst_group` which doesn't exists.

Wouldn't it be there that we need to keep destination_group and name always the same to make it working? I guess maybe we should force users to keep it the same?

destination_group would have to include name_suffix as well

@jmiguelhp
Copy link
Contributor Author

If we analyze common policy, i guess that there was 1 more broken thing:

---
apic:
  fabric_policies:
    monitoring:
      snmp_traps:
        - name: trap1
          destination_group: mon_snmp1_dst_grp

If we consider that we create an SNMP destination named "trap1" and also it automatically creates under monitoring common policy reference, in our case it will generate reference to 'mon_snmp1_dst_group` which doesn't exists.

Wouldn't it be there that we need to keep destination_group and name always the same to make it working? I guess maybe we should force users to keep it the same?

destination_group would have to include name_suffix as well

User should be in charge of make sure references are pointing to valid objects (e.g. when you define a BD under EPG, tool does not validate if the BD exists and no error is popped up). Also, an internal issue was raised where the engineers are not using the same name for both objetcs, instead, they create the SNMP destinations independently.

Let's meet and discuss this further.

Thanks!

faults = try(policy.faults, local.defaults.apic.fabric_policies.monitoring.syslogs.faults)
session = try(policy.session, local.defaults.apic.fabric_policies.monitoring.syslogs.session)
minimum_severity = try(policy.minimum_severity, local.defaults.apic.fabric_policies.monitoring.syslogs.minimum_severity)
destination_group = try("${policy.destination_group}${local.defaults.apic.fabric_policies.monitoring.syslogs.destination_group_suffix}", "")
Copy link
Contributor

@ogorczow ogorczow Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should read from:

---
defaults:
  apic:
    fabric_policies:
      monitoring:
        syslogs:
          name_suffix: ""

count = local.modules.aci_monitoring_policy == true && var.manage_fabric_policies ? 1 : 0
snmp_trap_policies = [for policy in try(local.fabric_policies.monitoring.snmp_traps, []) : {
name = "${policy.name}${local.defaults.apic.fabric_policies.monitoring.snmp_traps.name_suffix}"
destination_group = try("${policy.destination_group}${local.defaults.apic.fabric_policies.monitoring.snmp_traps.destination_group_suffix}", "")
Copy link
Contributor

@ogorczow ogorczow Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should read from:

---
defaults:
  apic:
    fabric_policies:
      monitoring:
        snmp_traps:
          name_suffix: ""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no need to create new destination_group_suffix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants