Skip to content
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

New template: cisco_xr_dir #1599

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ntc_templates/templates/cisco_xr_dir.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Value Filldown FILE_SYSTEM (\S+)
Value PERMISSIONS (.+?)
Value SIZE (\d+)
Value Fillup TOTAL_SIZE (\d+)
Value Fillup TOTAL_FREE (\d+)
Value DATE_MONTH (\w+)
Value DATE_DAY (\d+)
Value DATE_TIME (\d+:\d+)
Value NAME (\S+)

Start
^\s*$$
^\S{3}\s+\S{3}\s+\d{1,2}\s+\d+:\d+:\d+
^Directory\s+of\s+${FILE_SYSTEM}
^${PERMISSIONS}\.\s+\d+\s+${SIZE}\s+${DATE_MONTH}\s+${DATE_DAY}\s+${DATE_TIME}\s+${NAME} -> Record
^${TOTAL_SIZE}\s+kbytes\s+total\s+\(${TOTAL_FREE}\s+kbytes\s+free\)
^.* -> Error

EOF
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ cisco_xr_show_hsrp.textfsm, .*, cisco_xr, sh[[ow]] hs[[rp]]
cisco_xr_show_arp.textfsm, .*, cisco_xr, sh[[ow]] arp
cisco_xr_show_bgp.textfsm, .*, cisco_xr, sh[[ow]] bg[[p]]
cisco_xr_ping.textfsm, .*, cisco_xr, ping
cisco_xr_dir.textfsm, .*, cisco_xr, dir

dell_force10_show_ip_interface_brief.textfsm, .*, dell_force10, sh[[ow]] ip int[[erface]] br[[ief]]
dell_force10_show_vlan_brief.textfsm, .*, dell_force10, sh[[ow]] vl[[an]] br[[ief]]
Expand Down
21 changes: 21 additions & 0 deletions tests/cisco_xr/dir/cisco_xr_dir_01.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Tue Jan 16 17:08:43.028 AEST

Directory of /var/xr/scratch
74 drwxrwxrwx. 2 4096 Dec 6 19:39 resmon_debug
22 -rw-rw-rw-. 1 2464 Jan 7 19:34 status_file
11 drwx------. 2 16384 Nov 15 14:44 lost+found
13 drwxr-xr-x. 3 4096 Jan 7 19:32 shutdown
23 drwxrwxrwx. 3 4096 Nov 15 14:59 syslog-hm
68 drwxrwxrwx. 3 4096 Dec 5 22:00 asic-err-logs-backup
41 drwxr-xr-x. 3 4096 Nov 15 15:01 pam
15 lrwxrwxrwx. 1 12 Nov 15 14:58 config -> /misc/config
14 -rw-r--r--. 1 936 Jan 7 19:32 envoke_log
28 drwxrwxrwx. 2 4096 Jan 7 19:33 crypto
12 drwxr-xr-x. 3 4096 Dec 11 00:53 core
17 drwxrwxrwx. 2 4096 Nov 15 14:58 npu_drvr_cfg
55 drwxr-xr-x. 2 4096 Dec 5 22:46 nvgen_traces
38 -rw-------. 1 444 Nov 15 15:23 .bash_history
25 drwxrwxrwx. 9 4096 Jan 7 19:34 ztp
19 drwx---r-x. 2 4096 Nov 15 14:58 clihistory

3365348 kbytes total (3163632 kbytes free)
146 changes: 146 additions & 0 deletions tests/cisco_xr/dir/cisco_xr_dir_01.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
parsed_sample:
- date_day: "6"
date_month: "Dec"
date_time: "19:39"
file_system: "/var/xr/scratch"
name: "resmon_debug"
permissions: "74 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "7"
date_month: "Jan"
date_time: "19:34"
file_system: "/var/xr/scratch"
name: "status_file"
permissions: "22 -rw-rw-rw-"
size: "2464"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "14:44"
file_system: "/var/xr/scratch"
name: "lost+found"
permissions: "11 drwx------"
size: "16384"
total_free: "3163632"
total_size: "3365348"
- date_day: "7"
date_month: "Jan"
date_time: "19:32"
file_system: "/var/xr/scratch"
name: "shutdown"
permissions: "13 drwxr-xr-x"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "14:59"
file_system: "/var/xr/scratch"
name: "syslog-hm"
permissions: "23 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "5"
date_month: "Dec"
date_time: "22:00"
file_system: "/var/xr/scratch"
name: "asic-err-logs-backup"
permissions: "68 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "15:01"
file_system: "/var/xr/scratch"
name: "pam"
permissions: "41 drwxr-xr-x"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "14:58"
file_system: "/var/xr/scratch"
name: "config"
permissions: "15 lrwxrwxrwx"
size: "12"
total_free: "3163632"
total_size: "3365348"
- date_day: "7"
date_month: "Jan"
date_time: "19:32"
file_system: "/var/xr/scratch"
name: "envoke_log"
permissions: "14 -rw-r--r--"
size: "936"
total_free: "3163632"
total_size: "3365348"
- date_day: "7"
date_month: "Jan"
date_time: "19:33"
file_system: "/var/xr/scratch"
name: "crypto"
permissions: "28 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "11"
date_month: "Dec"
date_time: "00:53"
file_system: "/var/xr/scratch"
name: "core"
permissions: "12 drwxr-xr-x"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "14:58"
file_system: "/var/xr/scratch"
name: "npu_drvr_cfg"
permissions: "17 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "5"
date_month: "Dec"
date_time: "22:46"
file_system: "/var/xr/scratch"
name: "nvgen_traces"
permissions: "55 drwxr-xr-x"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "15:23"
file_system: "/var/xr/scratch"
name: ".bash_history"
permissions: "38 -rw-------"
size: "444"
total_free: "3163632"
total_size: "3365348"
- date_day: "7"
date_month: "Jan"
date_time: "19:34"
file_system: "/var/xr/scratch"
name: "ztp"
permissions: "25 drwxrwxrwx"
size: "4096"
total_free: "3163632"
total_size: "3365348"
- date_day: "15"
date_month: "Nov"
date_time: "14:58"
file_system: "/var/xr/scratch"
name: "clihistory"
permissions: "19 drwx---r-x"
size: "4096"
total_free: "3163632"
total_size: "3365348"