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

using cssh to generate multiple terms, each with a diff initial launch cmd #104

Open
deehill opened this issue Feb 28, 2018 · 7 comments
Open

Comments

@deehill
Copy link

deehill commented Feb 28, 2018

Trying to figure out how/if cssh can be used to generate multiple terms with different launch actions

/etc/clusters
testcluster7 -a '-t screen -r crawl1Session' [email protected]

cssh testcluster7
Doesn't work as cssh doesn't appear to be able to handle options

cssh -a '-t screen -r crawl1Session' [email protected]
This works, generates a term running the "screen -r crawl1Session cmd..

I could run separate cssh cmds from the local cmdline but the resulting cssh terms don't "tile" as they're unique processes.

Thoughts/Comments??

@zabbix112
Copy link

in your configure file you can set up many different commands to open certain server windows. I use mine for patching. I would set it up when I type, cssh prod1 will bring up just the first set of servers in a cluster. I would also set it up with cssh dev, cssh test, cssh stage, or cssh prod. Its all in the configure file. it will error until you have it setup right.

@deehill
Copy link
Author

deehill commented Feb 28, 2018

Hi zabbix112

As far as I can tell the /etc/clusters config file allows you to set up the different user@hosts and you can even group them in as many different ways as you choose.

However, I have yet to be able to set up a process where I can pass an action to a user@host within the /etc/clusters file.

from the cmd line this works
cssh --title '252' -a "-t screen -r crawl3Session" [email protected]

If you can show me a /etc/clusters file that allows you to have something like
group1 -a "vi /tmp/cat " user1@host1 -a "vi /tmp/dog" user1@host1

and run it from the cmdline as
cssh group1

so you then see two terms get displayed I'd lie to see it.

I can't figure out how to get an action (or separate actions) to work in the /etc/clusters file

@zabbix112
Copy link

Deehill,
Now here is the part where I dont know if I use it different from everyone else but I never touch the /etc/clusters config file I leave it alone.

So when you installed it did you install it as root and or under the rood dir?

if so do ls -la and you will see something .clusterssh file... cd to .clusterssh and then do a ls and
it will show you a config file. Here is the bread and butter of the file. Here is where I do all my commands.

Oh also you need to download ximg "its what I use if you have something different" now I say ximg is cause I have to work off a corporate windows laptop and then this allows me to create multiple windows of each server I am working on.

let me know if any of this helps.

@deehill
Copy link
Author

deehill commented Feb 28, 2018

hey...

Installed as root .. yum install ....

in the root dir ~/.csshrc which is consistent with what I've seen from other people

Are you telling me you can do something like (even from the cmdline)

cssh -a "vi /tmp/cat" [email protected] -a "vi /tmp/dog" [email protected]

and you then have 2 windows displayed in the same/single cssh process with one editing the tm/cat file and the other editing the tmp/dog file...

If I could get this to work.. that would be great as it would show how to initiate multiple terms with different actions passed in

@deehill
Copy link
Author

deehill commented Feb 28, 2018

now...

cssh -a "vi /home/crawl_user/cssh1.php" [email protected] [email protected]

works,, as it kicks off two windows each of which edits the same file...

but the above isn't the same as this..

cssh -a "vi /home/crawl_user/cssh1.php" [email protected] -a "vi /home/crawl_user/cssh2222.php" [email protected]

which edits a different file in each window. (and which doesn't work!)
but this is what I need

@duncs
Copy link
Owner

duncs commented Mar 15, 2018

What version of ClusterSSH are you using? The $HOME/.csshrc file is consistent with version 3, $HOME/.clusterssh/ directory is version 4

@TomGudman
Copy link

I think the feature @deehill is after is the equivalent of --hosts in csshX (the MacOSX version) which I need as well.

Ref: https://github.com/brockgr/csshx/blob/533b2626b5812cf9e1b7ff69589d6c98f4375d19/csshX#L2893-L2897

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

No branches or pull requests

4 participants