From a5cf16e7d98b5af6e255257b08ea093bca9d8145 Mon Sep 17 00:00:00 2001 From: Vivek Reddy Karri Date: Thu, 19 Aug 2021 03:02:30 +0000 Subject: [PATCH] show auto_ts history added Signed-off-by: Vivek Reddy Karri --- show/plugins/auto_techsupport.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/show/plugins/auto_techsupport.py b/show/plugins/auto_techsupport.py index ab280ea783..18b7b2954d 100644 --- a/show/plugins/auto_techsupport.py +++ b/show/plugins/auto_techsupport.py @@ -97,12 +97,20 @@ def AUTO_TECHSUPPORT_global(db): {'name': 'since', 'description': '', 'is-leaf-list': False, 'is-mandatory': False, 'group': ''} ), ] - body.append(row) click.echo(tabulate.tabulate(body, header)) - +@AUTO_TECHSUPPORT.command(name="history") +@clicommon.pass_db +def AUTO_TECHSUPPORT_history(db): + fv = db.db.get_all("STATE_DB", "AUTO_TECHSUPPORT|TS_CORE_MAP") + header = ["Techsupport Dump", "Triggered By", "Critical Process"] + body = [] + for field, value in fv.items(): + core_dump, _, supervisor_crit_proc = value.split(";") + body.append([field, core_dump, supervisor_crit_proc]) + click.echo(tabulate.tabulate(body, header)) def register(cli):