forked from networktocode/ntc-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cisco ios show snmp group (networktocode#1183)
* Added new template and tests. * Created cisco_ios_show_snmp_group.textfsm template. Co-authored-by: Nicholas Nelson - 10105570 <[email protected]>
- Loading branch information
1 parent
ef21911
commit a475a84
Showing
5 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,22 @@ | ||
Value Required GROUPNAME (\S+) | ||
Value SECURITY_MODEL ([\s\S]+?) | ||
Value CONTEXTNAME ([\s\S]+?) | ||
Value STORAGE_TYPE (\S+) | ||
Value READVIEW ([\s\S]+?) | ||
Value WRITEVIEW ([\s\S]+?) | ||
Value NOTIFYVIEW ([\s\S]+?) | ||
Value ROW_STATUS ([\s\S]+?) | ||
Value ACCESS_LIST (\S+) | ||
|
||
Start | ||
^\s*groupname:\s*\S+\s+security\s+model:\s*[\s\S]+\s*$$ -> Continue.Record | ||
^\s*groupname:\s*${GROUPNAME}\s+security\s+model:\s*${SECURITY_MODEL}\s*$$ | ||
^\s*contextname:\s+${CONTEXTNAME}\s+storage-type:\s+${STORAGE_TYPE}\s*$$ | ||
^\s*readview\s*:\s+${READVIEW}\s+writeview:\s+${WRITEVIEW}\s*$$ | ||
^\s*notifyview:\s+${NOTIFYVIEW}\s*$$ | ||
^\s*row\s+status:\s+${ROW_STATUS}(?:\s+access-list:\s+${ACCESS_LIST})*\s*$$ | ||
^\s*$$ | ||
# Capture time-stamp if vty line has command time-stamping turned on | ||
^Load\s+for\s+ | ||
^Time\s+source\s+is | ||
^. -> Error |
This file contains 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
41 changes: 41 additions & 0 deletions
41
tests/cisco_ios/show_snmp_group/cisco_ios_show_snmp_group.raw
This file contains 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,41 @@ | ||
groupname: GROUP1 security model:v3 priv | ||
contextname: <no context specified> storage-type: nonvolatile | ||
readview : g1readview writeview: <no writeview specified> | ||
notifyview: g1notifyview | ||
row status: active access-list: snmp-acl-name | ||
|
||
groupname: ILMI security model:v1 | ||
contextname: <no context specified> storage-type: permanent | ||
readview : *ilmi writeview: *ilmi | ||
notifyview: <no notifyview specified> | ||
row status: active | ||
|
||
groupname: ILMI security model:v2c | ||
contextname: <no context specified> storage-type: permanent | ||
readview : *ilmi writeview: *ilmi | ||
notifyview: <no notifyview specified> | ||
row status: active | ||
|
||
groupname: GROUP2 security model:v1 | ||
contextname: <no context specified> storage-type: nonvolatile | ||
readview : v1default writeview: <no writeview specified> | ||
notifyview: <no notifyview specified> | ||
row status: active access-list: snmp-acl-name | ||
|
||
groupname: GROUP2 security model:v2c | ||
contextname: <no context specified> storage-type: nonvolatile | ||
readview : v1default writeview: <no writeview specified> | ||
notifyview: <no notifyview specified> | ||
row status: active access-list: snmp-acl-name | ||
|
||
groupname: GROUP3 security model:v1 | ||
contextname: <no context specified> storage-type: nonvolatile | ||
readview : v1default writeview: <no writeview specified> | ||
notifyview: <no notifyview specified> | ||
row status: active access-list: snmp-acl-name | ||
|
||
groupname: GROUP3 security model:v2c | ||
contextname: <no context specified> storage-type: nonvolatile | ||
readview : v1default writeview: <no writeview specified> | ||
notifyview: <no notifyview specified> | ||
row status: active access-list: snmp-acl-name |
65 changes: 65 additions & 0 deletions
65
tests/cisco_ios/show_snmp_group/cisco_ios_show_snmp_group.yml
This file contains 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,65 @@ | ||
--- | ||
parsed_sample: | ||
- groupname: "GROUP1" | ||
security_model: "v3 priv" | ||
contextname: "<no context specified>" | ||
storage_type: "nonvolatile" | ||
readview: "g1readview" | ||
writeview: "<no writeview specified>" | ||
notifyview: "g1notifyview" | ||
row_status: "active" | ||
access_list: "snmp-acl-name" | ||
- groupname: "ILMI" | ||
security_model: "v1" | ||
contextname: "<no context specified>" | ||
storage_type: "permanent" | ||
readview: "*ilmi" | ||
writeview: "*ilmi" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "" | ||
- groupname: "ILMI" | ||
security_model: "v2c" | ||
contextname: "<no context specified>" | ||
storage_type: "permanent" | ||
readview: "*ilmi" | ||
writeview: "*ilmi" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "" | ||
- groupname: "GROUP2" | ||
security_model: "v1" | ||
contextname: "<no context specified>" | ||
storage_type: "nonvolatile" | ||
readview: "v1default" | ||
writeview: "<no writeview specified>" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "snmp-acl-name" | ||
- groupname: "GROUP2" | ||
security_model: "v2c" | ||
contextname: "<no context specified>" | ||
storage_type: "nonvolatile" | ||
readview: "v1default" | ||
writeview: "<no writeview specified>" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "snmp-acl-name" | ||
- groupname: "GROUP3" | ||
security_model: "v1" | ||
contextname: "<no context specified>" | ||
storage_type: "nonvolatile" | ||
readview: "v1default" | ||
writeview: "<no writeview specified>" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "snmp-acl-name" | ||
- groupname: "GROUP3" | ||
security_model: "v2c" | ||
contextname: "<no context specified>" | ||
storage_type: "nonvolatile" | ||
readview: "v1default" | ||
writeview: "<no writeview specified>" | ||
notifyview: "<no notifyview specified>" | ||
row_status: "active" | ||
access_list: "snmp-acl-name" |