Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support syslog related resources (DCNE-65) #1258

Open
bardahlm opened this issue Jul 18, 2024 · 1 comment
Open

Support syslog related resources (DCNE-65) #1258

bardahlm opened this issue Jul 18, 2024 · 1 comment
Labels
enhancement jira-sync Sync this issue to Jira

Comments

@bardahlm
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

To configure syslog a couple of new resources are needed.

Here is a aci_rest_managed configuration example that sets up syslog for tn common, fab common and fab default, mapping audit, events, faults and session to different facilities.

locals {
  syslog_server = "syslog.example.com"
  facility_mapping = {
    "audit"   = "local6"
    "events"  = "local5"
    "faults"  = "local4"
    "session" = "local3"
  }
}

resource "aci_rest_managed" "syslog_group" {
  for_each   = local.facility_mapping
  dn         = format("uni/fabric/slgroup-syslog_%s", each.value)
  class_name = "syslogGroup"
  content = {
    name                = format("syslog_%s", each.value)
    includeMilliSeconds = "yes"
    includeTimeZone     = "yes"
  }

  child {
    rn         = "console"
    class_name = "syslogConsole"
    content = {
      adminState = "disabled"
    }
  }

  child {
    rn         = "file"
    class_name = "syslogFile"
    content = {
      adminState = "disabled"
    }
  }

  child {
    rn         = "prof"
    class_name = "syslogProf"
  }
}

resource "aci_rest_managed" "syslog_remote_dest" {
  for_each   = local.facility_mapping
  dn         = format("%s/rdst-%s", resource.aci_rest_managed.syslog_group[each.key].dn, local.syslog_server)
  class_name = "syslogRemoteDest"
  content = {
    adminState         = "enabled"
    format             = "aci"
    forwardingFacility = each.value
    host               = local.syslog_server
    name               = format("syslog_%s", each.value)
    port               = "514"
    protocol           = "udp"
    severity           = "information"
  }

  child {
    rn         = "rsARemoteHostToEpg"
    class_name = "fileRsARemoteHostToEpg"
    content = {
      tDn = "uni/tn-mgmt/mgmtp-default/oob-default"
    }
  }
}

resource "aci_rest_managed" "tn_common_syslogsrc" {
  for_each   = local.facility_mapping
  dn         = format("uni/tn-common/monepg-default/slsrc-tn_common_%s", each.value)
  class_name = "syslogSrc"
  content = {
    name   = format("tn_common_%s", each.value)
    minSev = "information"
    incl   = each.key
  }
  child {
    rn         = "rsdestGroup"
    class_name = "syslogRsDestGroup"
    content = {
      tDn = resource.aci_rest_managed.syslog_group[each.key].id
    }
  }
}

resource "aci_rest_managed" "fab_common_syslog_src" {
  for_each   = local.facility_mapping
  dn         = format("uni/fabric/moncommon/slsrc-fab_common_%s", each.value)
  class_name = "syslogSrc"
  content = {
    name   = format("fab_common_%s", each.value)
    minSev = "information"
    incl   = each.key
  }

  child {
    rn         = "rsdestGroup"
    class_name = "syslogRsDestGroup"
    content = {
      tDn = resource.aci_rest_managed.syslog_group[each.key].id
    }
  }
}

resource "aci_rest_managed" "fab_default_syslog_src" {
  for_each   = local.facility_mapping
  dn         = format("uni/fabric/monfab-default/slsrc-fab_default_%s", each.value)
  class_name = "syslogSrc"
  content = {
    name   = format("fab_default_%s", each.value)
    minSev = "information"
    incl   = each.key
  }

  child {
    rn         = "rsdestGroup"
    class_name = "syslogRsDestGroup"
    content = {
      tDn = resource.aci_rest_managed.syslog_group[each.key].id
    }
  }
}

New or Affected Resource(s) + ACI Class(es):

Classes:

  • syslogGroup
  • syslogConsole
  • syslogFile
  • syslogProf
  • syslogRemoteDest
  • fileRsARemoteHostToEpg
  • syslogSrc
  • syslogRsDestGroup

APIC version and APIC Platform

  • V x.x.x and on-prem/cloud-aws/cloud-azure/all.

Potential Terraform Configuration

TBD

References

  • #0000
@akinross
Copy link
Collaborator

Hi @bardahlm,

Thank you for raising this issue, I have added it to the to do items.

@samiib samiib added the jira-sync Sync this issue to Jira label Aug 13, 2024
@github-actions github-actions bot changed the title Support syslog related resources Support syslog related resources (DCNE-65) Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement jira-sync Sync this issue to Jira
Projects
None yet
Development

No branches or pull requests

3 participants