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

Tweaking cylc monitor or cylc scan for easier use #1752

Closed
chanwilson opened this issue Mar 7, 2016 · 7 comments
Closed

Tweaking cylc monitor or cylc scan for easier use #1752

chanwilson opened this issue Mar 7, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@chanwilson
Copy link

Although it's a minor thing, it'd be nice if the output from a cylc scan could be cut-n-pasted and fed directly to a cylc monitor, instead of needing to transpose and --option-ize arguments...

Eg, enable usage like

cylc monitor `cylc scan --host localhost --all | grep LNOx` 
@hjoliver
Copy link
Member

hjoliver commented Mar 8, 2016

Chan,

I'm not sure I entirely understand what you're suggesting. If you know a suite's name and host, you can just give that directly to "cylc monitor", but if it might be any one of several suites with names that match a
pattern, then you might find more than one suite running and the monitor command will fail. Or do you know the suite's name, but not which host it is running on? Either way, your scan command line looks wrong. By default "cylc scan" will scan localhost, or a list of hosts set in the global config file. To scan other hosts, list them as command line arguments, not options: "cylc scan HOST1 HOST2 ..."

@chanwilson
Copy link
Author

Hilary,

OK, better usage example:

cylc scan output is like so:

fre.awg_ulm_201505.c96L48_am4g7_fullchem_nitrate_cloud_LNOx.multiple.19810101-20100101 Joe.User@localhost:7770

cylc monitor needs the user@host:port split apart into arguments, it can't be fed (cut-n-paste or backticks ) directly. Annoying. Minor glob of perl workaround (replace print with exec in use) to transmorgify things:

cylc scan --host an006 --all --pyro-timeout=3 | grep LNOx | perl -nae '($u,$h,$p) = $F[1] =~ /(.*?)@(.*?):(\d+)/; print qq{cylc monitor --user $u --host $h --port $p $F[0]\n}'
cylc monitor --user Joe.User --host localhost --port 7770 fre.awg_ulm_201505.c96L48_am4g7_fullchem_nitrate_cloud_LNOx.multiple.19810101-20100101

make more sense now? 😁

@matthewrmshin matthewrmshin added this to the later milestone Mar 8, 2016
@hjoliver
Copy link
Member

hjoliver commented Mar 8, 2016

Chan, thanks for clarifying. OK, it's not an unreasonable request given that users often want to monitor suites found by port scanning. Note your use of the --host option with cylc scan probably isn't doing anything - see #1754.

@hjoliver
Copy link
Member

hjoliver commented Mar 8, 2016

So: this would be the CLI analogue of clicking on a suite in gscan to open a gcylc instance

@oliver-sanders
Copy link
Member

Would something like this be acceptable?

master...oliver-sanders:1752.cylc-monitor-gscan-copy-paste

@hjoliver
Copy link
Member

Yeah that's good, thanks - put up a PR. @chanwilson - if you're out there, do you want to take a look? On Oliver's branch I can do this:

cylc monitor $(cylc scan host1 | grep foo)

@chanwilson
Copy link
Author

Looks dandy! thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants