Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Running commands on remote machines Post 302740687 by jim mcnamara on Thursday 6th of December 2012 03:11:47 PM
Old 12-06-2012
It all works the same. You have to have the SAME username on all 602 boxes, two monitoring boxes, 600 monitor-ees. Likewise everybody needs 602 home directories with an .ssh subdirectory, that has protections 600. The home directory for each has to be 755 or 751 or even 700. The perms cannot be 77[n].

You can also have a mishmash of usernames if you want, but keeping track and matching everything up is a nightmare.

The account on each remote box has to have perms to run your commands.

1. create ssh-keys on both servers, place the keys from each server on the remotes.
This is 1200 cp operations, assuming you have accounts and home directories and .ssh directories set up.

You likely already have infrastructure existing to do this - like an ftp server for everybody.

2. Run your monitoring script using ssh from one of the two monitor boxes.
Code:
ssh remotenodename 'mpstat; iostat -n'  >> /logs/remoteserver.log

Failover is up to you, if the two monitoring boxes are clustered that works.

Here is how to create your keys. The rsa.pub is the public key you send out everywhere
and place it in /home/user/.ssh/authorized_keys

ssh-keygen: password-less SSH login
This User Gave Thanks to jim mcnamara For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Running a script on multiple machines

To clear the web cache on my web server, I run this command: find $APACHE_HOME/cache/plsql/plsql -type d -name "*" -exec rm -R {} \; To clear the cache on all the web servers(we have 4), I log on to any one machine, clear its cache, ssh to another machine, clear cache etc; Is there any way... (8 Replies)
Discussion started by: nattynatty
8 Replies

2. UNIX for Advanced & Expert Users

How do I check file dates on remote machines

Hi .. I want to check the date for one file which is present on the remote machine. How do i do that?? Also if i'm only having the sudo rights .. can i do that with my login or do i need all the access rights?? Please let me know asap. (3 Replies)
Discussion started by: decci_7
3 Replies

3. Solaris

scp - copy between two remote machines?

1. scp person1@10.10.10.1:file1 person2@10.10.10.2:file1 2. scp file1 person1@10.10.10.1:file1 For #1, I keep getting this error: Password: Host key verification failed. lost connection I have entered the correct password too! #2 works fine. I suppose I cannot copy a file between two... (6 Replies)
Discussion started by: kungpow
6 Replies

4. Shell Programming and Scripting

running commands to remote host from centralized host

Gurus/Experts We have a centralized UNIX/Solaris server from where we can actually ssh to all other UNIX/Solaris servers...I need to write a script that reside on this centerlized server and do FileSystem monitoring (basically run df -h or -k) of other remote servers and then send an email to me... (6 Replies)
Discussion started by: anjum.suri
6 Replies

5. Shell Programming and Scripting

how to ssh to remote unix machines using private/public key

hello, iam able to ssh to a linux server from a linux server called "machine1" using the private/public key method, so I dont need to enter any password when I run my script but iam not able to ssh from machine1 to a UNIX server, access is denied. note that I am using an application id which is... (6 Replies)
Discussion started by: wydadi
6 Replies

6. Shell Programming and Scripting

Shell Script to find out if a process is running on any all machines

Hi All, I have been a guest visitor from a long time and this forum is wonderful. I finally am a member of this forum too, so i am here stuck with a shell script that i was trying to write My requirement is that i should be able to create a shell script which will check if a process is running on... (3 Replies)
Discussion started by: Rex0226
3 Replies

7. Shell Programming and Scripting

Running commands in remote node as root user

Platform :Oracle Linux 6.4 We are trying to automate the SAN level cloning from production RAC DB cluster to test. From a shell script, I would like to run the below command Step1,2 and 3 from Node1 in a sequential order as root user . How can I do this ? passwordless for root user is not... (2 Replies)
Discussion started by: kraljic
2 Replies

8. Shell Programming and Scripting

Running set of commands in remote servers in shell script

Hi Wishing to all. I am very new joined in an organization as a unix system administrator. I need a help in preparing a script for a report. i have a file contains all of the linux/ubuntu servers line by line around 140 servers. vi servers.txt nh01 nh02 nh03 bh01 bh04 - - :wq (3 Replies)
Discussion started by: kumaraswamy
3 Replies

9. Shell Programming and Scripting

Running Commands on a Remote Linux Server over SSH

Hello, I'm trying to create a ksh script to ssh to a remote server, enter the password and a couple commands. For security reasons I have changed the login, password and ip in my example. #!/bin/ksh ssh -t -t username@12.5.5.3 << EOF password cd bin pwd EOF When I run it. It... (5 Replies)
Discussion started by: seekryts15
5 Replies

10. Shell Programming and Scripting

Ssh - running commands on remote server

Hi, I am trying to run commands on a list of servers that I can ssh to and just want to know if there is a 'cleaner' way of doing this. At the moment, I am doing as below. Is there a way that I can escape the double quote differently? If a use a single quote to enclose the commands that I... (1 Reply)
Discussion started by: newbie_01
1 Replies
cf-runagent(8)						      System Manager's Manual						    cf-runagent(8)

NAME
cf-runagent - Run agent SYNOPSIS
: cf-runagent [options] DESCRIPTION
: The run agent connects to a list of running instances of the cf-serverd service. The agent allows a user to forego the usual scheduling interval for the agent and activate cf-agent on a remote host. Additionally, a user can send additional classes to be defined on the remote host. Two kinds of classes may be sent: classes to decide on which hosts the agent will be started, and classes that the user requests the agent should define on execution. The latter type is regulated by cf-serverd's role based access control. cfengine is a self-healing con- figuration and change management based system. You can think of cfengine as a very high level language, much higher level than Perl or shell. Asingle statement is called a promise, and compliance can result in many hundreds of filesbeing created, or the permissions of many hundreds offiles being set. The idea of cfengine is to create a one or more sets of configuration files which willclassify and describe the setup of every host in a network. COMMAND LINE OPTIONS
: --help, -h Print the help message --background, -b Parallelize connections (50 by default) --debug, -d Set debugging level 0,1,2,3 --verbose, -v Output verbose information about the behaviour of the agent --dry-run, -n All talk and no action mode - make no changes, only inform of promises not kept --version, -V Output the version of the software --file, -f Specify an alternative input file than the default --define-class, -D Define a list of comma separated classes to be sent to a remote agent --select-class, -s Define a list of comma separated classes to be used to select remote agents by constraint --inform, -I Print basic information about changes made to the system, i.e. promises repaired --remote-options, -o Pass options to a remote server process --diagnostic, -x Activate internal diagnostics (developers only) --hail, -H Hail the following comma-separated lists of hosts, overriding default list --interactive, -i Enable interactive mode for key trust --query, -q Query a server for a knowledge menu --timeout, -t Connection timeout, seconds AUTHOR
Mark Burgess and CFEngine AS INFORMATION
Bug reports: http://bug.cfengine.com, .PP Community help: http://forum.cfengine.com Community info: http://www.cfengine.com/pages/community Support services: http://www.cfengine.com This software is Copyright (C) 2008-2013 CFEngine AS. Maintenance Commands cf-runagent(8)
All times are GMT -4. The time now is 08:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy