Skip to content

Commit

Permalink
Merge pull request #2 from tbotnz/enhancement-1
Browse files Browse the repository at this point in the history
improve-class-map
  • Loading branch information
tbotnz authored Jul 9, 2021
2 parents b8bd920 + 13c9a41 commit 2aa67c5
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 21 deletions.
22 changes: 22 additions & 0 deletions example-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,28 @@ no ip http secure-server
!
snmp-server community cat RO
snmp-server community test RO
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps ospf state-change if-state-change neighbor-state-change
snmp-server enable traps bgp state-changes all
snmp-server enable traps config-copy
snmp-server enable traps config
snmp-server enable traps isis state-change
snmp-server enable traps ipsla
snmp-server enable traps ether-oam
snmp-server enable traps memory bufferpeak
snmp-server enable traps entity-state
snmp-server enable traps entity
snmp-server enable traps cpu threshold
snmp-server enable traps rep
snmp-server enable traps entity-sensor
snmp-server enable traps resource-policy
snmp-server enable traps flash insertion
snmp-server enable traps flash removal
snmp-server enable traps mpls ldp session-up session-down
snmp-server enable traps pw vc
snmp-server enable traps bulkstat collection transfer
snmp-server enable traps mac-notification
snmp-server enable traps transceiver all
no cdp log mismatch duplex
!
!
Expand Down
161 changes: 141 additions & 20 deletions example-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@
"match": {
"type": "dscp",
"value": [
"af41"
"af41 "
]
}
},
Expand All @@ -801,7 +801,7 @@
"match": {
"type": "dscp",
"value": [
"ef"
"ef "
]
}
},
Expand All @@ -811,7 +811,7 @@
"match": {
"type": "dscp",
"value": [
"af32"
"af32 "
]
}
},
Expand All @@ -821,7 +821,7 @@
"match": {
"type": "dscp",
"value": [
"af22"
"af22 "
]
}
},
Expand All @@ -831,7 +831,7 @@
"match": {
"type": "dscp",
"value": [
"default"
"default "
]
}
},
Expand All @@ -841,7 +841,7 @@
"match": {
"type": "dscp",
"value": [
"af11"
"af11 "
]
}
},
Expand Down Expand Up @@ -871,27 +871,36 @@
"match": {
"type": "cos",
"value": [
"5"
"5 "
]
}
},
{
"match_type": "any",
"class_name": "CM-GROUP6",
"match": {
"type": "qos-group",
"value": [
"6"
]
}
"match": [
{
"type": "qos-group",
"value": [
"6"
]
},
{
"type": "dscp",
"value": [
"cs6",
"cs7 "
]
}
]
},
{
"match_type": "all",
"class_name": "cos4",
"match": {
"type": "cos",
"value": [
"4"
"4 "
]
}
},
Expand All @@ -901,7 +910,7 @@
"match": {
"type": "cos",
"value": [
"3"
"3 "
]
}
},
Expand All @@ -911,7 +920,7 @@
"match": {
"type": "cos",
"value": [
"2"
"2 "
]
}
},
Expand All @@ -931,7 +940,7 @@
"match": {
"type": "cos",
"value": [
"1"
"1 "
]
}
},
Expand All @@ -951,7 +960,7 @@
"match": {
"type": "cos",
"value": [
"0"
"0 "
]
}
},
Expand Down Expand Up @@ -988,7 +997,7 @@
{
"type": "dscp",
"value": [
"cs4"
"cs4 "
]
}
]
Expand Down Expand Up @@ -1095,7 +1104,119 @@
},
{
"community": "test",
"mode": "RO"
"mode": "RO",
"enabled_traps": [
{
"traps": [
"snmp authentication linkdown linkup coldstart warmstart"
]
},
{
"traps": [
"ospf state-change if-state-change neighbor-state-change"
]
},
{
"traps": [
"bgp state-changes all"
]
},
{
"traps": [
"config-copy"
]
},
{
"traps": [
"config"
]
},
{
"traps": [
"isis state-change"
]
},
{
"traps": [
"ipsla"
]
},
{
"traps": [
"ether-oam"
]
},
{
"traps": [
"memory bufferpeak"
]
},
{
"traps": [
"entity-state"
]
},
{
"traps": [
"entity"
]
},
{
"traps": [
"cpu threshold"
]
},
{
"traps": [
"rep"
]
},
{
"traps": [
"entity-sensor"
]
},
{
"traps": [
"resource-policy"
]
},
{
"traps": [
"flash insertion"
]
},
{
"traps": [
"flash removal"
]
},
{
"traps": [
"mpls ldp session-up session-down"
]
},
{
"traps": [
"pw vc"
]
},
{
"traps": [
"bulkstat collection transfer"
]
},
{
"traps": [
"mac-notification"
]
},
{
"traps": [
"transceiver all"
]
}
]
}
],
"line": [
Expand Down
2 changes: 1 addition & 1 deletion show_run.ttp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ policy-map {{ policy_map | re(".+") | record(vrf) }}
<group name="global.policy.class">
class-map match-{{match_type}} {{class_name}}
<group name="match">
match {{type}} {{ value | unrange(rangechar='-', joinchar=' ' ) | split(' ') }}
match {{type}} {{ value | | re(".+") | unrange(rangechar='-', joinchar=' ' ) | split(' ') }}
</group>
</group>

Expand Down

0 comments on commit 2aa67c5

Please sign in to comment.