alces-software / adminware

A sandbox CLI for running commands remotely across nodes
1 stars 0 forks source link

Feat/node log #104

Closed DavidMarchant closed 5 years ago

DavidMarchant commented 5 years ago

EDIT: Fixes #101 Add new command for retrieving a history of commands ran on a single node Currently listed under batch node-log NODE as it's only relevant to batch commands, they're the only ones that are committed to the db

adminware> batch node-log localhost
╔════════════╦═══════════════╦════════════════╦════════════════════════════╦═══════════╦═══════════╗
║ Command    ║ Last Batch ID ║ Last Exit Code ║ Date                       ║ Arguments ║ Times Ran ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ new_test   ║ 250           ║ 0              ║ 2018-10-23 14:50:27.807623 ║ None      ║ 1         ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ pgrep      ║ 252           ║ 2              ║ 2018-10-24 10:53:14.956108 ║ None      ║ 2         ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ steve      ║ 226           ║ 0              ║ 2018-10-18 16:43:48.341738 ║ None      ║ 9         ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd10 ║ 253           ║ None           ║ 2018-10-24 13:30:37.074175 ║ None      ║ 13        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd11 ║ 249           ║ 0              ║ 2018-10-23 11:36:39.463931 ║ None      ║ 13        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd3  ║ 247           ║ 0              ║ 2018-10-23 11:36:38.246693 ║ None      ║ 32        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd5  ║ 242           ║ 0              ║ 2018-10-23 11:35:59.893082 ║ None      ║ 17        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd6  ║ 229           ║ -2             ║ 2018-10-23 10:54:07.187795 ║ None      ║ 50        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd8  ║ 248           ║ 0              ║ 2018-10-23 11:36:38.831787 ║ None      ║ 12        ║
╠════════════╬═══════════════╬════════════════╬════════════════════════════╬═══════════╬═══════════╣
║ test_cmd9  ║ 230           ║ 0              ║ 2018-10-23 10:54:07.696828 ║ None      ║ 13        ║
╚════════════╩═══════════════╩════════════════╩════════════════════════════╩═══════════╩═══════════╝
DavidMarchant commented 5 years ago

sure thing :+1: the only comment I have is 'No. Reruns' - won't this be one off the value it's displaying? i.e. if a command's been run once '1' will be displayed, despite the fact it's been 'Reran' 0 times

WilliamMcCumstie commented 5 years ago

Hmm I don't think that is to big of an issue. If we really want, we can make it (re)runs

WilliamMcCumstie commented 5 years ago

Actually we can change it to No. Runs and that will remove the confusion completely

DavidMarchant commented 5 years ago

Yep, sounds good :slightly_smiling_face: shall you or i do it?

DavidMarchant commented 5 years ago

It has been done - here https://github.com/alces-software/adminware/commit/8db4ddcfd99c10469fdadd3c3a05e4537a845548