Skip to content

Commit

Permalink
closes #27 #26 #25 #28
Browse files Browse the repository at this point in the history
  • Loading branch information
camrossi committed Nov 6, 2024
1 parent 24c8b7a commit cdbc165
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/aci-monitoring-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.7
version: 0.1.8
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
36 changes: 36 additions & 0 deletions charts/aci-monitoring-stack/config.d/aci-configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#This file is used to ingest the APIC configs to then analyse/display it inside Grafana.
class_queries:
subnets:
class_name: fvSubnet
query_parameter: '?order-by=fvSubnet.dn'
metrics:
- name: subnets
value_name: fvSubnet.attributes.uid
labels:
- property_name: fvSubnet.attributes.dn
regex: "^uni/tn-(?P<bd_tenant>.*)/BD-(?P<bd_name>.*)/subnet-\\[(?P<subnet>.*)\\]"

epg_to_bd:
class_name: fvRsBd
query_parameter: '?order-by=fvRsBd.dn'
metrics:
- name: epg_to_bd
value_name: fvRsBd.attributes.uid
labels:
- property_name: fvRsBd.attributes.dn
regex: "^uni/tn-(?P<epg_tenant>.*)/ap-(?P<app>.*)/epg-(?P<epg>.*)/rsbd"
- property_name: fvRsBd.attributes.tDn
regex: "^uni/tn-(?P<bd_tenant>.*)/BD-(?P<bd_name>.*)"

bd_to_vrf:
class_name: fvRtCtx
query_parameter: '?order-by=fvRtCtx.dn'
metrics:
- name: bd_to_vrf
value_name: fvRtCtx.attributes.status
value_transform:
'' : 0
labels:
- property_name: fvRtCtx.attributes.dn
regex: "^uni/tn-(?P<vrf_tenant>.*)/ctx-(?P<vrf_name>.*)/rtctx-\\[uni/tn-(?P<bd_tenant>.*)/BD-(?P<bd_name>.*)\\]"

1 change: 1 addition & 0 deletions charts/aci-monitoring-stack/config.d/system.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class_queries:
'unknown': 7
'decommissioned': 8
'maintenance': 9
'commissioned': 10
labels:
- property_name: fabricNode.attributes.name
regex: "^(?P<name>.*)"
Expand Down
34 changes: 33 additions & 1 deletion charts/aci-monitoring-stack/config.d/vlan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,66 +57,98 @@ class_queries:
'link-up': 3
- name: epg_rx_flood
value_name: vlanCktEp.children.[l2IngrBytes5min].attributes.floodCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_rx_multicast
value_name: vlanCktEp.children.[l2IngrBytes5min].attributes.multicastCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_rx_unicast
value_name: vlanCktEp.children.[l2IngrBytes5min].attributes.unicastCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_rx_drop
value_name: vlanCktEp.children.[l2IngrBytes5min].attributes.dropCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_tx_flood
value_name: vlanCktEp.children.[l2EgrBytes5min].attributes.floodCum
value_name: vlanCktEp.children.[l2EgrBytes5min].attributes.floodCum+
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_tx_multicast
value_name: vlanCktEp.children.[l2EgrBytes5min].attributes.multicastCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_tx_unicast
value_name: vlanCktEp.children.[l2EgrBytes5min].attributes.unicastCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_tx_drop
value_name: vlanCktEp.children.[l2EgrBytes5min].attributes.dropCum
value_transform:
'': 0
type: counter
unit: "bytes"
- name: epg_rx_flood
value_name: vlanCktEp.children.[l2IngrPkts5min].attributes.floodCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_rx_multicast
value_name: vlanCktEp.children.[l2IngrPkts5min].attributes.multicastCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_rx_unicast
value_name: vlanCktEp.children.[l2IngrPkts5min].attributes.unicastCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_rx_drop
value_name: vlanCktEp.children.[l2IngrPkts5min].attributes.dropCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_tx_flood
value_name: vlanCktEp.children.[l2EgrPkts5min].attributes.floodCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_tx_multicast
value_name: vlanCktEp.children.[l2EgrPkts5min].attributes.multicastCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_tx_unicast
value_name: vlanCktEp.children.[l2EgrPkts5min].attributes.unicastCum
value_transform:
'': 0
type: counter
unit: "pkts"
- name: epg_tx_drop
value_name: vlanCktEp.children.[l2EgrPkts5min].attributes.dropCum
value_transform:
'': 0
type: counter
unit: "pkts"

Expand Down
174 changes: 162 additions & 12 deletions charts/aci-monitoring-stack/dashboards/epg-explore.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}
]
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.1",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -237,7 +237,7 @@
}
]
},
"pluginVersion": "11.1.0",
"pluginVersion": "11.2.1",
"targets": [
{
"datasource": {
Expand Down Expand Up @@ -303,6 +303,123 @@
}
],
"type": "table"
},
{
"datasource": {
"default": true,
"type": "prometheus",
"uid": "prometheus"
},
"description": "Maps a Subnet to a BD and EPG",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 20
},
"id": 3,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "11.2.1",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"exemplar": false,
"expr": " (\n aci_bd_to_vrf\n + on (fabric, bd_name, bd_tenant) group_right (vrf_name, vrf_tenant)\n (\n aci_subnets{fabric=\"$fabric\",subnet=\"$subnet\"}\n + on (fabric, bd_name, bd_tenant) group_right ()\n aci_epg_to_bd\n )\n >=\n 0\n )\nor on ()\n (\n label_replace(\n aci_subnets{fabric=\"$fabric\",subnet=\"$subnet\"}\n + on (fabric, bd_name, bd_tenant) group_right ()\n aci_epg_to_bd,\n \"vrf_name\",\n \"NO VRF\",\n \"vrf_name\",\n \".*\"\n )\n )",
"format": "table",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "__auto",
"range": false,
"refId": "A"
}
],
"title": "Subnets",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"aci": true,
"fabric": true,
"instance": true,
"job": true
},
"includeByName": {},
"indexByName": {
"Time": 1,
"Value": 12,
"aci": 2,
"app": 4,
"bd_name": 7,
"bd_tenant": 6,
"epg": 5,
"epg_tenant": 3,
"fabric": 0,
"instance": 10,
"job": 11,
"vrf_name": 9,
"vrf_tenant": 8
},
"renameByName": {
"app": "App",
"bd_name": "BD",
"bd_tenant": "BD Tenant",
"epg": "EPG",
"epg_tenant": "EPG Tenant",
"vrf_name": "VRF",
"vrf_tenant": "VRF Tenant"
}
}
}
],
"type": "table"
}
],
"refresh": "",
Expand Down Expand Up @@ -342,7 +459,7 @@
},
{
"current": {
"selected": true,
"selected": false,
"text": "common",
"value": "common"
},
Expand Down Expand Up @@ -372,8 +489,12 @@
{
"current": {
"selected": true,
"text": [],
"value": []
"text": [
"FileServer"
],
"value": [
"FileServer"
]
},
"datasource": {
"type": "prometheus",
Expand All @@ -400,12 +521,12 @@
},
{
"current": {
"selected": false,
"selected": true,
"text": [
""
"2"
],
"value": [
""
"2"
]
},
"datasource": {
Expand Down Expand Up @@ -433,12 +554,12 @@
},
{
"current": {
"selected": false,
"selected": true,
"text": [
""
"7536649"
],
"value": [
""
"7536649"
]
},
"datasource": {
Expand All @@ -463,6 +584,35 @@
"skipUrlSync": false,
"sort": 3,
"type": "query"
},
{
"current": {
"selected": false,
"text": "192.168.100.1/24",
"value": "192.168.100.1/24"
},
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"definition": "label_values(aci_subnets{fabric=\"$fabric\"},subnet)",
"description": "",
"hide": 0,
"includeAll": false,
"label": "Subnet",
"multi": false,
"name": "subnet",
"options": [],
"query": {
"qryType": 1,
"query": "label_values(aci_subnets{fabric=\"$fabric\"},subnet)",
"refId": "PrometheusVariableQueryEditor-VariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
Expand All @@ -474,6 +624,6 @@
"timezone": "",
"title": "EPG Explore",
"uid": "a4f7ea75-6ef6-4639-809a-755684e11ac1",
"version": 10,
"version": 8,
"weekStart": ""
}
Loading

0 comments on commit cdbc165

Please sign in to comment.