bkilaru
February 23, 2015, 11:33am
1
Hello Folks - Need help really ASAP.
Iam trying to run this Shell command to get all the lists of partitions and disks from across all the servers.
#!/bin/ksh
_servers=""
_out="/tmp/output.$$"
_ssh=/usr/bin/ssh
>$_out
for s in $_servers
do
$_ssh $s fdisk -l >> $_out
done
And in what way does it not work?
bkilaru
February 23, 2015, 12:13pm
3
Hello -
So when i try to run this shell, this is the output that iam getting.
ksh: line 1: fdisk: not found
Where is fdisk on these servers?
bkilaru
February 23, 2015, 1:11pm
5
/sbin
also i was trying to do this in all the 262 servers that we have....so that i can get the list of all the disks and partitions and send these details in the output....i dont want to try and manually login to each server and type the command.
bkilaru
February 23, 2015, 2:27pm
7
Yes i know it worked before, but i want to know how i can incorporate that in the Script? so that it doesn't error out when i run the script.
RudiC
February 23, 2015, 5:13pm
8
How about
$_ssh $s /sbin/fdisk -l >> $_out
Thanks for the code...Sorry took me a while to realize there was a reply