bpb25
asked on
Script to obtain hardware and OS information
I’ve just been tasked to obtain the version of Solaris and the type of Sun workstation the user is using. I know the uname –a command can give me the info I need. What I don’t want to do is have to telnet to over 400 machines. Is there a way, I can write a script which rsh’s to each machine by it’s IP address (5.212.144.xxx, 5.212.145.xxx) and write the output of each machine’s uname –a to a text file?
Thanks,
Brian
Thanks,
Brian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
x=`expr ($x+1)`
back single quotes, for a command substitution
back single quotes, for a command substitution
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi
You must have remote authentication database set
So create a file /.rhosts(assuming you will remotely login as root)
enter your system name
create a script and execute the script
#/bin/sh
x=1
for i in 144 145
do
while($x < 255)
do
rsh 5.212.$i.$x uname -a >> /tmp/info.txt
x=`expr $x + 1`
done
done
regards
sagar
You must have remote authentication database set
So create a file /.rhosts(assuming you will remotely login as root)
enter your system name
create a script and execute the script
#/bin/sh
x=1
for i in 144 145
do
while($x < 255)
do
rsh 5.212.$i.$x uname -a >> /tmp/info.txt
x=`expr $x + 1`
done
done
regards
sagar
ASKER
syntax error at line 7: 'x=expr' unexpected
Luckily the majority of the machines already have a .rhosts in place.