-
Notifications
You must be signed in to change notification settings - Fork 43
'fp.monitoring' fixed and expanded (Issue623) #267
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
Open
jmiguelhp
wants to merge
8
commits into
netascode:main
Choose a base branch
from
jmiguelhp:Issue623
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1606bce
'fp.moniroring' fixed and expanded (Issue623)
jmiguelhp 3d59937
Fix typos
jmiguelhp 7fca57a
Fix typos
jmiguelhp d605f46
Updates as per Oskar comments.
jmiguelhp cbc5f51
pre-commit run
jmiguelhp bda1c13
SNMP/Syslog destination suffix added.
jmiguelhp c04265c
Merge branch 'main' into Issue623
jmiguelhp f6b7d78
Revert changes in current modules for backwards compatibility
jmiguelhp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
modules/terraform-aci-monitoring-policy-user-defined/.terraform-docs.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| version: '>= 0.14.0' | ||
|
|
||
| formatter: markdown table | ||
|
|
||
| content: |- | ||
| # Terraform ACI User-Defined Monitoring Policy Module | ||
|
|
||
| Manages ACI User-Defined Monitoring Policy | ||
|
|
||
| Location in GUI: | ||
| `Fabric` » `Fabric Policies` » `Policies` » `Monitoring` | ||
|
|
||
| ## Examples | ||
|
|
||
| ```hcl | ||
| {{ include "./examples/complete/main.tf" }} | ||
| ``` | ||
|
|
||
| {{ .Requirements }} | ||
|
|
||
| {{ .Providers }} | ||
|
|
||
| {{ .Inputs }} | ||
|
|
||
| {{ .Outputs }} | ||
|
|
||
| {{ .Resources }} | ||
|
|
||
| output: | ||
| file: README.md | ||
| mode: replace | ||
|
|
||
| sort: | ||
| enabled: false |
83 changes: 83 additions & 0 deletions
83
modules/terraform-aci-monitoring-policy-user-defined/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| <!-- BEGIN_TF_DOCS --> | ||
| # Terraform ACI User-Defined Monitoring Policy Module | ||
|
|
||
| Manages ACI User-Defined Monitoring Policy | ||
|
|
||
| Location in GUI: | ||
| `Fabric` » `Fabric Policies` » `Policies` » `Monitoring` | ||
|
|
||
| ## Examples | ||
|
|
||
| ```hcl | ||
| module "aci_monitoring_policy_user_defined" { | ||
| source = "netascode/nac-aci/aci//modules/terraform-aci-monitoring-policy-user-defined" | ||
| version = "> 1.0.1" | ||
|
|
||
| name = "MON1" | ||
| snmp_trap_policies = [{ | ||
| name = "SNMP_1" | ||
| destination_group = "SNMP_DEST_GROUP1" | ||
| }] | ||
| syslog_policies = [{ | ||
| name = "SYSLOG1" | ||
| audit = false | ||
| events = false | ||
| faults = false | ||
| session = true | ||
| minimum_severity = "alerts" | ||
| destination_group = "SYSLOG_DEST_GROUP1" | ||
| }] | ||
| fault_severity_policies = [{ | ||
| class = "snmpClient" | ||
| faults = [{ | ||
| fault_id = "F1368" | ||
| description = "Fault 1368 nice description" | ||
| initial_severity = "critical" | ||
| target_severity = "inherit" | ||
| }] | ||
| }] | ||
| } | ||
| ``` | ||
|
|
||
| ## Requirements | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 | | ||
| | <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.0.0 | | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.0.0 | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_name"></a> [name](#input\_name) | Track List name. | `string` | n/a | yes | | ||
| | <a name="input_description"></a> [description](#input\_description) | Description. | `string` | `""` | no | | ||
| | <a name="input_snmp_trap_policies"></a> [snmp\_trap\_policies](#input\_snmp\_trap\_policies) | List of SNMP trap policies. | <pre>list(object({<br/> name = string<br/> destination_group = optional(string, "")<br/> }))</pre> | `[]` | no | | ||
| | <a name="input_syslog_policies"></a> [syslog\_policies](#input\_syslog\_policies) | List of syslog policies. Default value `audit`: true. Default value `events`: true. Default value `faults`: true. Default value `session`: false. Default value `minimum_severity`: `warnings`. | <pre>list(object({<br/> name = string<br/> audit = optional(bool, true)<br/> events = optional(bool, true)<br/> faults = optional(bool, true)<br/> session = optional(bool, false)<br/> minimum_severity = optional(string, "warnings")<br/> destination_group = optional(string, "")<br/> }))</pre> | `[]` | no | | ||
| | <a name="input_fault_severity_policies"></a> [fault\_severity\_policies](#input\_fault\_severity\_policies) | List of Fault Severity Assignment Policies. | <pre>list(object({<br/> class = string<br/> faults = list(object({<br/> fault_id = string<br/> initial_severity = optional(string, "inherit")<br/> target_severity = optional(string, "inherit")<br/> description = optional(string, "")<br/> }))<br/> }))</pre> | `[]` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_dn"></a> [dn](#output\_dn) | Distinguished name of Fabric `monFabricPol` object. | | ||
| | <a name="output_name"></a> [name](#output\_name) | User-Defined Fabric Monitoring Policy name. | | ||
|
|
||
| ## Resources | ||
|
|
||
| | Name | Type | | ||
| |------|------| | ||
| | [aci_rest_managed.faultSevAsnP](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.monFabricPol](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.monFabricTarget](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.snmpRsDestGroup](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.snmpSrc](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.syslogRsDestGroup](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| | [aci_rest_managed.syslogSrc](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
| <!-- END_TF_DOCS --> |
24 changes: 24 additions & 0 deletions
24
modules/terraform-aci-monitoring-policy-user-defined/examples/complete/.terraform-docs.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| version: '>= 0.14.0' | ||
|
|
||
| formatter: markdown table | ||
|
|
||
| content: |- | ||
| # Monitoring Policy Example | ||
|
|
||
| To run this example you need to execute: | ||
|
|
||
| ```bash | ||
| $ terraform init | ||
| $ terraform plan | ||
| $ terraform apply | ||
| ``` | ||
|
|
||
| Note that this example will create resources. Resources can be destroyed with `terraform destroy`. | ||
|
|
||
| ```hcl | ||
| {{ include "./main.tf" }} | ||
| ``` | ||
|
|
||
| output: | ||
| file: README.md | ||
| mode: replace |
44 changes: 44 additions & 0 deletions
44
modules/terraform-aci-monitoring-policy-user-defined/examples/complete/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <!-- BEGIN_TF_DOCS --> | ||
| # Monitoring Policy Example | ||
|
|
||
| To run this example you need to execute: | ||
|
|
||
| ```bash | ||
| $ terraform init | ||
| $ terraform plan | ||
| $ terraform apply | ||
| ``` | ||
|
|
||
| Note that this example will create resources. Resources can be destroyed with `terraform destroy`. | ||
|
|
||
| ```hcl | ||
| module "aci_monitoring_policy_user_defined" { | ||
| source = "netascode/nac-aci/aci//modules/terraform-aci-monitoring-policy-user-defined" | ||
| version = "> 1.0.1" | ||
|
|
||
| name = "MON1" | ||
| snmp_trap_policies = [{ | ||
| name = "SNMP_1" | ||
| destination_group = "SNMP_DEST_GROUP1" | ||
| }] | ||
| syslog_policies = [{ | ||
| name = "SYSLOG1" | ||
| audit = false | ||
| events = false | ||
| faults = false | ||
| session = true | ||
| minimum_severity = "alerts" | ||
| destination_group = "SYSLOG_DEST_GROUP1" | ||
| }] | ||
| fault_severity_policies = [{ | ||
| class = "snmpClient" | ||
| faults = [{ | ||
| fault_id = "F1368" | ||
| description = "Fault 1368 nice description" | ||
| initial_severity = "critical" | ||
| target_severity = "inherit" | ||
| }] | ||
| }] | ||
| } | ||
| ``` | ||
| <!-- END_TF_DOCS --> |
28 changes: 28 additions & 0 deletions
28
modules/terraform-aci-monitoring-policy-user-defined/examples/complete/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| module "aci_monitoring_policy_user_defined" { | ||
| source = "netascode/nac-aci/aci//modules/terraform-aci-monitoring-policy-user-defined" | ||
| version = "> 1.0.1" | ||
|
|
||
| name = "MON1" | ||
| snmp_trap_policies = [{ | ||
| name = "SNMP_1" | ||
| destination_group = "SNMP_DEST_GROUP1" | ||
| }] | ||
| syslog_policies = [{ | ||
| name = "SYSLOG1" | ||
| audit = false | ||
| events = false | ||
| faults = false | ||
| session = true | ||
| minimum_severity = "alerts" | ||
| destination_group = "SYSLOG_DEST_GROUP1" | ||
| }] | ||
| fault_severity_policies = [{ | ||
| class = "snmpClient" | ||
| faults = [{ | ||
| fault_id = "F1368" | ||
| description = "Fault 1368 nice description" | ||
| initial_severity = "critical" | ||
| target_severity = "inherit" | ||
| }] | ||
| }] | ||
| } |
11 changes: 11 additions & 0 deletions
11
modules/terraform-aci-monitoring-policy-user-defined/examples/complete/versions.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| terraform { | ||
| required_version = ">= 1.3.0" | ||
|
|
||
| required_providers { | ||
| aci = { | ||
| source = "CiscoDevNet/aci" | ||
| version = ">= 2.0.0" | ||
jmiguelhp marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can check this with Justyna. I tried to keep it the way it is in order to ensure backwards compatibility.
As per my tests, common policy does not allow changes in Fault severities.
Not sure about this one. Hope you can elaborate it