Skip to content

Commit

Permalink
Merge pull request #3 from tbotnz/enhancement-1
Browse files Browse the repository at this point in the history
Enhancement 1
  • Loading branch information
tbotnz authored Jul 9, 2021
2 parents 2aa67c5 + 3e66153 commit 5fa53b7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 116 deletions.
136 changes: 24 additions & 112 deletions example-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,118 +1105,30 @@
{
"community": "test",
"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"
]
}
]
"enabled_traps": {
"snmp authentication linkdown linkup coldstart warmstart": {},
"ospf state-change if-state-change neighbor-state-change": {},
"bgp state-changes all": {},
"config-copy": {},
"config": {},
"isis state-change": {},
"ipsla": {},
"ether-oam": {},
"memory bufferpeak": {},
"entity-state": {},
"entity": {},
"cpu threshold": {},
"rep": {},
"entity-sensor": {},
"resource-policy": {},
"flash insertion": {},
"flash removal": {},
"mpls ldp session-up session-down": {},
"pw vc": {},
"bulkstat collection transfer": {},
"mac-notification": {},
"transceiver all": {}
}
}
],
"line": [
Expand Down
7 changes: 3 additions & 4 deletions show_run.ttp
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ enable password {{ password }}
snmp-server community {{community | _start_ }} {{mode}}
snmp-server host {{trap_host | _start_ }} {{community}}
snmp-server trap-source {{trap_source}}
<group name="enabled_traps">
snmp-server enable traps {{ traps | re(".+") | split(' ') }}
<group name="enabled_traps.{{ traps_name }}">
snmp-server enable traps {{ traps_name | re(".+")}}
</group>
snmp-server host {{trap_host | _start_ }} version 2c {{community}}
</group>


<group name="management.logging">
logging facility {{facility}}
logging source-interface {{source_interface}}
Expand Down Expand Up @@ -306,7 +305,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 | | re(".+") | unrange(rangechar='-', joinchar=' ' ) | split(' ') }}
match {{type}} {{ value | re(".+") | unrange(rangechar='-', joinchar=' ' ) | split(' ') }}
</group>
</group>

Expand Down

0 comments on commit 5fa53b7

Please sign in to comment.