Link to home
Start Free TrialLog in
Avatar of bpb25
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
ASKER CERTIFIED SOLUTION
Avatar of liddler
liddler
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bpb25
bpb25

ASKER

Ran the script, here's the error I got.

syntax error at line 7: 'x=expr' unexpected

Luckily the majority of the machines already have a .rhosts in place.

x=`expr ($x+1)`
back single quotes, for a command substitution
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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