2 ################################################################################
5 # Description: Displays information about a machine
6 # Author: Andrew@DeFaria.com
7 # Created: Fri Apr 30 14:13:56 PDT 1999
10 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
12 ################################################################################
13 # Set me to command name
17 adm_base=${adm_base:-//sonscentral/Corporate/Software/adm}
20 adm_fpath=${adm_fpath:-$adm_base/functions}
26 machines=${machines:-$adm_base/data/machines}
28 if [ ! -f $machines ]; then
29 echo "$me: Error: Unable to find $machines file!"
33 function display_machine_info {
37 line=$(grep -i "^$machine:" $machines 2> /dev/null)
39 if [ "_$line" = "_" ]; then
40 echo "No information on machine $machine"
42 machine=$(echo $line | cut -f1 -d:)
43 ip_address=$(echo $line | cut -f2 -d:)
44 model=$(echo $line | cut -f3 -d:)
45 osversion=$(echo $line | cut -f4 -d:)
46 ccversion=$(echo $line | cut -f5 -d:)
47 owner=$(echo $line | cut -f6 -d:)
48 phone=$(echo $line | cut -f7 -d:)
49 usage=$(echo $line | cut -f8 -d:)
50 class=$(echo $line | cut -f9 -d:)
51 location=$(echo $line | cut -f10 -d:)
52 eclipseid=$(echo $line | cut -f11 -d:)
53 echo -e "Machine:\t\t$machine"
54 echo -e "IP Address:\t\t$ip_address"
55 echo -e "Model:\t\t\t$model"
56 echo -e "OS Version:\t\t$osversion"
57 echo -e "ClearCase Version:\t$ccversion"
58 echo -e "Owner:\t\t\t$owner" | tr -s "(" "<" | tr -s ")" ">"
59 echo -e "Phone:\t\t\t$phone"
60 echo -e "Usage:\t\t\t$usage"
61 echo -e "Class:\t\t\t$class"
62 echo -e "Location:\t\t$location"
64 } # display_machine_info
66 function dump_all_machines {
67 grep -v "^#" $machines | cut -f1 -d: | while read machine; do
69 --------------------------------------------------------------------------------
70 display_machine_info $machine
74 display_machine_info $(uname -n)
76 if [ "$1" = "-all" ]; then
80 display_machine_info $i