Sponsored Content
Top Forums Shell Programming and Scripting Bash Script to pull ipa server name on 500 servers Post 302971013 by vtowntechy on Thursday 14th of April 2016 05:47:30 PM
Old 04-14-2016
Bash Script to pull ipa server name on 500 servers

Hello All,
I need help writing a bash script that will run on 500 LINUX servers and do the following:

1. Capture the ipa_server name from /etc/sssd/sssd.conf on a list of 500 servers in the ipahosts file.

2. Write to a file outputing only server name and IPA server name.


Root ssh keys are enabled on all servers so automated login will occur. I really need help just extracting ONLY the IPA server information out of the file. I was playing around with grep and awk but haven't figured out the exact syntax.

Appreciate any help with this, Thanks


So far I have this:
Code:
#!bin/bash
for i in $(cat ipahosts)
do
hostname
cat /etc/sssd/sssd.conf >>ipa_servers_list
done


Last edited by Don Cragun; 04-14-2016 at 07:52 PM.. Reason: Add CODE an ICODE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Pull a file from a remote server through a shell script

Hi, I am writing a shell script to pull a file from a remote server (Let say its a windows based remote server). One of my criteria is to pull a file only if it is not empty. We have done a similar script to push a file from our end to a remote server and before pushing it we check for the... (2 Replies)
Discussion started by: sashankkrk
2 Replies

2. Shell Programming and Scripting

Script to pull Archives from Server A to Server B

Hi all, Iam looking out for a script which pulls archive logs from Server A to Server B. At the same time we donot want the archives to be deleted from Server A. Request you to please help me on this. Thanks, Vivek (1 Reply)
Discussion started by: vivi.raghav
1 Replies

3. Shell Programming and Scripting

Archive log Pull script from one server to another server

Hi all, Iam looking out for a shell script which pulls archive from Server A to Server B. And at the same time, we dont want the archives which are already pulled in Server B to be removed from Server A. Please help me on this, I have been trying on this for a quiet few time. ... (3 Replies)
Discussion started by: vivi.raghav
3 Replies

4. Shell Programming and Scripting

bash script to execute a command remote servers using ssh

Hello, I am running into few issues, please suggest me what I am missing. I am running this script on a linux host. Main idea of this script is to, login to each host via ssh and get uid of user, service user that I trying to run this script, has already deployed ssh keys and provide sudo... (8 Replies)
Discussion started by: bobby320
8 Replies

5. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

6. Shell Programming and Scripting

Bash script connect to remote servers and become root

Hi, I need a script that will connect to a list of servers and first sudo to root and then run a couple of commands. For security reasons, we can't setup ssh keys as root. Manually I have to login to a server as user and then sudo to root. It's not possible to use root@servername , because of... (8 Replies)
Discussion started by: misterx12345
8 Replies

7. Shell Programming and Scripting

Script to pull uid greater than 1000 from remote server

Hello, I am trying to get UID # greater than 1000 from all linux server, I tried this script getting this error message, someone please suggest. $for i in `cat hostlist.0709.org` ; do ssh -t $i 'awk -F':' "{ if($3 >= 1000) print $0 }" /etc/passwd ' >> output ; done $ cat output hostname1... (4 Replies)
Discussion started by: bobby320
4 Replies

8. Shell Programming and Scripting

Bash script - cygwin (powershell?) pull from GitHub API Parse JSON

All, Have a weird issue where i need to generate a report from GitHub monthly detailing user accounts and the last time they logged in. I'm using a windows box to do this (work issued) and would like to know if anyone has any experience scripting for GitAPI using windows / cygwin / powershell?... (9 Replies)
Discussion started by: ChocoTaco
9 Replies

9. Shell Programming and Scripting

Pull Netgroup from Servers

Hi, How to pull netgroup from all servers I think the netgroup resides in /etc/security/access.conf so I want to know how to get the list of netgroup in all the servers. I have a jump server I can run the script from there to get the list but not sure how to do the script. Any ideas or... (1 Reply)
Discussion started by: dbashyam
1 Replies

10. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
ipa-client-automount(1) 					 IPA Manual Pages					   ipa-client-automount(1)

NAME
ipa-client-automount - Configure automount and NFS for IPA SYNOPSIS
ipa-client-automount [OPTION]... <location> DESCRIPTION
Configures automount for IPA. The automount configuration consists of three files: o /etc/nsswitch.conf o /etc/sysconfig/autofs o /etc/autofs_ldap_auth.conf By default this will use DNS discovery to attempt to determine the IPA server(s) to use. If IPA servers are discovered then the automount client will be configured to use DNS discovery. If DNS discovery fails or a specific server is desired, use the --server option. The default automount location is named default. To specify a different one use the --location option. The IPA client must already be configured in order to configure automount. The IPA client is configured as part of a server installation. There are two ways to configure automount. The default is to use sssd to manage the automount maps. Alternatively autofs can configured to bind to LDAP over GSSAPI and authenticate using the machine's host principal. The nsswitch automount service is configured to use either sss or ldap and files depending on whether SSSD is configured or not. NFSv4 is also configured. The rpc.gssd and rpc.idmapd are started on clients to support Kerberos-secured mounts. OPTIONS
--server=SERVER Set the IPA server to connect to --location=LOCATION Automount location -S, --no-sssd Do not configure the client to use SSSD for automount -d, --debug Print debugging information to stdout -U, --unattended Unattended installation. The user will not be prompted --uninstall Restore the automount configuration files FILES
Files that will be always be configured: /etc/nsswitch.conf Files that will be configured when SSSD is the automount client (default): /etc/sssd/sssd.conf Files that will be configured when using the ldap automount client: /etc/sysconfig/autofs /etc/autofs_ldap_auth.conf EXIT STATUS
0 if the installation was successful 1 if an error occurred IPA
May 25 2012 ipa-client-automount(1)
All times are GMT -4. The time now is 11:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy