Solved

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

Posted on 2014-02-05
9
306 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
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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now