From 8c4376045336470fb14eb4ad815598e6aa01e071 Mon Sep 17 00:00:00 2001 From: SAndeep Singh Rawat Date: Sun, 25 Feb 2018 15:07:15 +0530 Subject: [PATCH] adding --- templates/arista_eos_bash_df_-h.template | 20 ++++ .../arista_eos_show_reload_cause.template | 42 +++++++ templates/index | 2 + .../bash_df_-h/arista_eos_bash_df_-h.parsed | 107 ++++++++++++++++++ .../bash_df_-h/arista_eos_bash_df_-h.raw | 14 +++ .../arista_eos_show_reload_cause.parsed | 9 ++ .../arista_eos_show_reload_cause.raw | 15 +++ 7 files changed, 209 insertions(+) create mode 100644 templates/arista_eos_bash_df_-h.template create mode 100644 templates/arista_eos_show_reload_cause.template create mode 100644 tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.parsed create mode 100644 tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.raw create mode 100644 tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.parsed create mode 100644 tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.raw diff --git a/templates/arista_eos_bash_df_-h.template b/templates/arista_eos_bash_df_-h.template new file mode 100644 index 0000000000..b09e3e72ac --- /dev/null +++ b/templates/arista_eos_bash_df_-h.template @@ -0,0 +1,20 @@ +Value FILE_SYSTEM (\S+) +Value SIZE (\S+) +Value USED (\S+) +Value AVAIL (\S+) +Value USE_PERCENT (\S+) +Value MOUNTED_ON (\S+) + +Start + ^Filesystem.*Mounted on$$ -> Data + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +Data + ^${FILE_SYSTEM}\s+${SIZE}\s+${USED}\s+${AVAIL}\s+${USE_PERCENT}\s+${MOUNTED_ON} -> Record + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +EOF diff --git a/templates/arista_eos_show_reload_cause.template b/templates/arista_eos_show_reload_cause.template new file mode 100644 index 0000000000..977cc356b6 --- /dev/null +++ b/templates/arista_eos_show_reload_cause.template @@ -0,0 +1,42 @@ +Value RELOAD_CAUSE (.+) +Value RELOAD_TIME (.+) +Value RECOMMENDED_ACTION (.+) +Value DEBUG_INFO (.+) + + +Start + ^Reload Cause 1: + ^--.+ + ^${RELOAD_CAUSE} -> RT + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +RT + ^\s+ + ^Reload Time: + ^--.+ + ^${RELOAD_TIME} -> RA + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +RA + ^\s+ + ^Recommended Action: + ^--.+ + ^${RECOMMENDED_ACTION} -> DI + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +DI + ^\s+ + ^Debugging Information: + ^--.+ + ^${DEBUG_INFO} -> Record + ^\s+$$ + ^$$ + ^.* -> Error "LINE NOT FOUND" + +EOF diff --git a/templates/index b/templates/index index 04ecff448a..c73ba24a4d 100644 --- a/templates/index +++ b/templates/index @@ -27,6 +27,7 @@ arista_eos_show_ip_bgp_summary.template, .*, arista_eos, sh[[ow]] i[[p]] bg[[p]] arista_eos_show_isis_neighbors.template, .*, arista_eos, sh[[ow]] isis ne[[ighbors]] arista_eos_show_lldp_neighbors.template, .*, arista_eos, sh[[ow]] ll[[dp]] nei[[ghbors]] arista_eos_show_snmp_community.template, .*, arista_eos, sh[[ow]] sn[[mp]] com[[munity]] +arista_eos_show_reload_cause.template, .*, arista_eos, sh[[ow]] relo[[ad]] ca[[use]] arista_eos_show_boot-config.template, .*, arista_eos, sh[[ow]] boot-c[[onfig]] arista_eos_show_interfaces.template, .*, arista_eos, sh[[ow]] inte[[rfaces]] arista_eos_show_inventory.template, .*, arista_eos, sh[[ow]] inv[[entory]] @@ -35,6 +36,7 @@ arista_eos_show_ip_route.template, .*, arista_eos, sh[[ow]] i[[p]] rou[[te]] arista_eos_show_version.template, .*, arista_eos, sh[[ow]] ver[[sion]] arista_eos_show_ip_arp.template, .*, arista_eos, sh[[ow]] i[[p]] ar[[p]] arista_eos_show_ip_bgp.template, .*, arista_eos, sh[[ow]] i[[p]] bg[[p]] +arista_eos_bash_df_-h.template, .*, arista_eos, bas[[h]] d[[f]] [[-h]] arista_eos_show_clock.template, .*, arista_eos, sh[[ow]] clo[[ck]] arista_eos_show_mlag.template, .*, arista_eos, sh[[ow]] ml[[ag]] arista_eos_show_vlan.template, .*, arista_eos, sh[[ow]] vl[[an]] diff --git a/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.parsed b/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.parsed new file mode 100644 index 0000000000..cfa36cb009 --- /dev/null +++ b/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.parsed @@ -0,0 +1,107 @@ +--- + +parsed_sample: + + +- avail : '4.5G' + used : '44M' + size : '4.6G' + mounted_on : '/' + file_system : 'none' + use_percent : '1%' + + +- avail : '4.5G' + used : '44M' + size : '4.6G' + mounted_on : '/.overlay' + file_system : 'none' + use_percent : '1%' + + +- avail : '8.0M' + used : '0' + size : '8.0M' + mounted_on : '/dev' + file_system : 'devtmpfs' + use_percent : '0%' + + +- avail : '16G' + used : '0' + size : '16G' + mounted_on : '/dev/shm' + file_system : 'tmpfs' + use_percent : '0%' + + +- avail : '16G' + used : '4.4M' + size : '16G' + mounted_on : '/run' + file_system : 'tmpfs' + use_percent : '1%' + + +- avail : '16G' + used : '0' + size : '16G' + mounted_on : '/sys/fs/cgroup' + file_system : 'tmpfs' + use_percent : '0%' + + +- avail : '4.6G' + used : '308K' + size : '4.6G' + mounted_on : '/tmp' + file_system : 'tmpfs' + use_percent : '1%' + + +- avail : '63M' + used : '1.2M' + size : '64M' + mounted_on : '/.deltas' + file_system : 'tmpfs' + use_percent : '2%' + + +- avail : '16G' + used : '0' + size : '16G' + mounted_on : '/var/run/netns' + file_system : 'tmpfs' + use_percent : '0%' + + +- avail : '3.1G' + used : '0' + size : '3.1G' + mounted_on : '/var/core' + file_system : 'tmpfs' + use_percent : '0%' + + +- avail : '3.0G' + used : '93M' + size : '3.1G' + mounted_on : '/var/log' + file_system : 'tmpfs' + use_percent : '3%' + + +- avail : '807M' + used : '218M' + size : '1.0G' + mounted_on : '/var/shmem' + file_system : 'tmpfs' + use_percent : '22%' + + +- avail : '2.2G' + used : '1.2G' + size : '3.3G' + mounted_on : '/mnt/flash' + file_system : '/dev/sda1' + use_percent : '35%' \ No newline at end of file diff --git a/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.raw b/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.raw new file mode 100644 index 0000000000..0c3158df34 --- /dev/null +++ b/tests/arista_eos/bash_df_-h/arista_eos_bash_df_-h.raw @@ -0,0 +1,14 @@ +Filesystem Size Used Avail Use% Mounted on +none 4.6G 44M 4.5G 1% / +none 4.6G 44M 4.5G 1% /.overlay +devtmpfs 8.0M 0 8.0M 0% /dev +tmpfs 16G 0 16G 0% /dev/shm +tmpfs 16G 4.4M 16G 1% /run +tmpfs 16G 0 16G 0% /sys/fs/cgroup +tmpfs 4.6G 308K 4.6G 1% /tmp +tmpfs 64M 1.2M 63M 2% /.deltas +tmpfs 16G 0 16G 0% /var/run/netns +tmpfs 3.1G 0 3.1G 0% /var/core +tmpfs 3.1G 93M 3.0G 3% /var/log +tmpfs 1.0G 218M 807M 22% /var/shmem +/dev/sda1 3.3G 1.2G 2.2G 35% /mnt/flash \ No newline at end of file diff --git a/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.parsed b/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.parsed new file mode 100644 index 0000000000..ecae14663e --- /dev/null +++ b/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.parsed @@ -0,0 +1,9 @@ +--- + +parsed_sample: + + +- recommended_action : 'No action necessary.' + debug_info : 'None available.' + reload_cause : 'The system rebooted due to a Power Loss' + reload_time : 'Reload occurred at Fri Feb 23 14:18:49 2018 UTC.' \ No newline at end of file diff --git a/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.raw b/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.raw new file mode 100644 index 0000000000..915e251ed5 --- /dev/null +++ b/tests/arista_eos/show_reload_cause/arista_eos_show_reload_cause.raw @@ -0,0 +1,15 @@ +Reload Cause 1: +------------------- +The system rebooted due to a Power Loss + +Reload Time: +------------ +Reload occurred at Fri Feb 23 14:18:49 2018 UTC. + +Recommended Action: +------------------- +No action necessary. + +Debugging Information: +---------------------- +None available. \ No newline at end of file