Solved

How to change an entry in config file to 100 linux servers

Posted on 2014-02-05
9
309 Views
Last Modified: 2014-02-17
How can I change the entry in /etc/kdump.conf from 10.10.10.10    to 11.11.11.11
by running a script from a central server and modifying the kdump.conf file in all 100 servers?
0
Comment
Question by:oo_tatang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 6

Expert Comment

by:Jordan Medlen
ID: 39835513
I would recommend setting up rsync on all servers as well as root login via key file over ssh. Then you can make the change to the "central server" and have a script run that will rsync the file to all other servers and restart the service if necessary.
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39835530
If this (or work like this) is going to be a frequent occurrence, you might want to install puppet on the systems.
0
 
LVL 6

Expert Comment

by:Shiju Jacob
ID: 39836269
try

for i in `cat hostlist`; do scp file* $i:/tmp/; done

hostlist are the ip of the hosts
/tmp you can have your path
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 23

Expert Comment

by:savone
ID: 39836426
I use CSSH for stuff like this.  It will open all 100 ssh sessions and let you work with all of them with one entry.

http://sourceforge.net/projects/clusterssh/
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39838051
i also suggest CSSH.
0
 

Author Comment

by:oo_tatang
ID: 39844675
I have my central server working already. The problem is i dont want to login to each and every server and vi the /etc/kdump.conf file and change the entry in the file from xx.xx.xx.xx ip entry to yy.yy.yy.yy which is time consuming .
0
 
LVL 19

Expert Comment

by:simon3270
ID: 39845185
Is the file the same on all servers? Of so, rcp or scp might be the best solution. You will have to set up ssh keys between the central machine an the 100 servers

if the files are not all the same, Puppet would seem to be better. With it, you can update a single line in a file
0
 

Author Comment

by:oo_tatang
ID: 39848977
How is puppet obtain. I am looking for a script to run in order to ssh to each server and change the entry in the /etc/kdump.conf file of each servers. The file configuration for each serves are not the  same. Please help
0
 
LVL 19

Accepted Solution

by:
simon3270 earned 500 total points
ID: 39849221
Puppet may be in the repositories for your distribution, or you candownload it free on puppetlabs.com.  You install the Puppet server on your central machine, and the Puppet agent on the 100 other servers.  You then set up a single configuration file on the central server to set the kdump line to have 11.11.11.11 in it, and the agents then all pick up the instructions and modify the file.  That line is then controlled by Puppet - if anyone tries to change the line on one of the 100 servers manually later on, puppet will set it back to 11.11.11.11.

That may seem overkill for just changing a single line, but once Puppet is installed, making other changes on all of the servers is much easier.

if you really want to use ssh, and you have set up ssh keys (with no passphrase) from the central node to the 100, with the node names one per line in remote_nodes.lst, then

for remnode in $(cat remote_nodes.lst); do

  ssh $remnode 'sed -i s/10.10.10.10/11.11.11.11/ /etc/kdump.conf'

don

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux mount of Windows Shared Now Fails 8 115
Recover Lacie Edmini data. 11 65
Can't connect to FTP 18 107
database connection error mysql stops 7 28
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question