Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-02-05
9
Medium Priority
?
312 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 20

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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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 20

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 20

Accepted Solution

by:
simon3270 earned 1500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

722 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