|
|
A shell script to get machine serial numbers
I ran into this problem myself when I had to collect system information on a decent amount of hosts so I wasted an evening coming up with something that'd do the job for me
This TCL/expect script ssh-s into each host listed in $hostfile and executes all the commands in $scriptfile The script assumes you have thesame $user on each $host; it will prompt you once for the password which you can enter without it being displayed and it will try to log in into each host and execute the commands, logging _everything_ in $host.output in your current working directory You still have to set the variable user in the script to your login; in the script file you specify each command line with full pathname You invoke the script with >expect sweeper.exp todo.txt hosts.txt
todo.txt containing the commands (1 command/line) I made this by trial & error - TCL gurus, please do not smite me ---
A shell script to get machine serial numbers
I tried this script using "system_profiler SPMemoryDataType" in my todo.txt, but the output files are zero kb. I tried using "ls" as the command, just in case it's a problem with system_profiler, but I got the same result. The script logs in to the remote machines correctly, and I get an "OK" for each machine, but something seems to be breaking on the output. Any suggestions? All machines are running 10.3.3. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:Hints1 new Hints in the last 24 hoursComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|