Script required


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script required
# 8  
Old 02-17-2013
@RudiC:
Your script does not work. Should be either
Code:
while read SERVER
do
  echo "$SERVER"
  ssh -x "$SERVER" /bin/sh << EOF
df / /tmp /any
# eventually more commands
EOF
done < /tmp/List.txt > /tmp/output.txt

or
Code:
while read SERVER
do
  echo "$SERVER"
  ssh -nx "$SERVER" '
df / /tmp /any
# eventually more commands
'
done < /tmp/List.txt > /tmp/output.txt

Tip: if you have more than 50 systems to monitor, then install "Xymon" (earlier named "BigBrother" and "Hobbit").
It has a Web page with green/yellow/red self-clearing alerts, drill-down by mouse-click, and provides alert history and graphical history, availability reports, trend analysis.

Last edited by MadeInGermany; 02-17-2013 at 01:02 PM.. Reason: Stripped the OPTIONS (what for?)
# 9  
Old 02-17-2013
Well, it worked exactly as given when I tested it on some of the servers I have access to, admittedly linux systems. And it does right now, testing again.
On the other hand, it was meant as a direction indicator for the requestor to develop his or her own script.
# 10  
Old 02-18-2013
You are right, your solution should work too.
It runs an interactive login shell but without a terminal.
If .profile etc. are not broken, it works nevertheless.
# 11  
Old 02-18-2013
Code:
[root@server1:/]#
#-> ssh john@server2 df -k /tmp
The authenticity of host 'server2 (XX.XX.XX.XX)' can't be established.
RSA key fingerprint is xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'server2' (RSA) to the list of known hosts.
Password:
/tmp (xxxxxxx ) : 11444928 total allocated Kb
11386216 free allocated Kb
58712 used allocated Kb
1 % allocation used
[root@server1:/]#
#->

That is fine, thanks for suggestion and support.
As I have large number of existing server which doest not have ssh key setup. As I tried to check on some server but it asked for password.
Is there any other way to perfrom this without asking for password ?

Last edited by vbe; 02-18-2013 at 09:17 AM.. Reason: Please use code tags for your code and data!
# 12  
Old 02-18-2013
The only way to do password less authentication is to configure ssh-keys.
# 13  
Old 02-20-2013
Thanks to all for their support, still seeking for some parameter by which I can pass the Password and Yes via script and do not required to put it manually.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Not able to get the required o/p from my script

Hi Experts, I have a script as below : # cat a.sh var=`mysql -usupport -p'testing' -e "select count(1) from db_test.sampletable;"` echo $var the output of this script is : count(1) 145039 Now i want to remove header from my o/p and modify somewhat like 145039 I have... (9 Replies)
Discussion started by: mukulverma2408
9 Replies

2. UNIX for Dummies Questions & Answers

Perl Script:how to find how many parameters are required to run the script

How to find how many parameters are required to run a Perl script? (1 Reply)
Discussion started by: Lakshman_Gupta
1 Replies

3. Shell Programming and Scripting

script required

This is the input file contents "data",9999,"data",999 "ddd"y"dat","dat","dart" 9999,999,999,"dat" 99,78,"duhu"yes"duhu" I need the output file contents "data",9999,"data",999 "dddydat","dat","dart" 9999,999,999,"dat" 99,78,"duhuyesduhu" Please use code tags when posting data and... (5 Replies)
Discussion started by: polineni
5 Replies

4. Shell Programming and Scripting

Help required to get a script

Hi Experts, I am very beginner in Bash Shell Scripting. Can anyone please guide me to create a script which should show the most busy file systems in sort basis as there are a lot of file systems on the server. I was told this task to be done by my IT lead and I must have to do this in... (3 Replies)
Discussion started by: naw_deepak
3 Replies

5. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

6. UNIX for Advanced & Expert Users

Help required in this script.

Hi Everyone, Please find below the script, I needed to understand step by step:confused:. Please If someone can help me out i will be very greatful:D. Please Guide me in a way which can help me out in figuring what this script doing on my server. ... (3 Replies)
Discussion started by: jojo123
3 Replies

7. Shell Programming and Scripting

Script Required

Hello guys, Need a help.I have a flat file. QWER 2:35 7044 00001 ROUT 1188 EA SS ASD 2:36 7044 00010 ROUT BSD 2:37 7044 00011 ROUT END QWER 3:35 7044 00011 ROUT 1088 EA SS ASD 3:36 7044 00010 ROUT BSD 3:37 7044 00011 ROUT END QWER 2:35 7044 00001 ROUT 1188 EA SS ASD ... (1 Reply)
Discussion started by: Satadru
1 Replies

8. Shell Programming and Scripting

Script required

Hi All, I have file nodes.txt that contains node names one by one. I'm running the following command. /opt/OV/bin/ovet_topodump.ovpl -nodeif <nodename> -detail Field <nodename> should take (replace) the node names from the nodes.txt one by one till last node. Pls. give me script for... (1 Reply)
Discussion started by: ntgobinath
1 Replies

9. Shell Programming and Scripting

script required

The line is like this +abc+def+mgh+ddsdsd+sa i.e. words seperated by +. There is a plus in the beginning. i want to conver this line to abc, def, mgh, ddsdsd, sa please provide the logic in the form of a shell script Thanks in advance (13 Replies)
Discussion started by: skyineyes
13 Replies

10. Shell Programming and Scripting

Script help required!

Hi there, i am trying to create a script that checks for the existence of users on the system, if they exist then their details should print on the screen with a message that the id is in use. I am having a bit of trouble with it. Any ideas? Cheers Kev! (8 Replies)
Discussion started by: kev112
8 Replies
Login or Register to Ask a Question