Changeset 114
- Timestamp:
- 02/17/06 18:30:21 (3 years ago)
- Files:
-
- trunk/server/admin/perl/info (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/server/admin/perl/info
r101 r114 7 7 8 8 $mac = ""; 9 10 # 11 # SMBios constants 12 # 13 14 @typetbl = ( "", "", "", "Desktop", "Low Profile Desktop", 15 "Pizza Box", "Mini Tower", "Tower", "Portable", "LapTop", "Notebook", 16 "Hand Held", "Docking Station", "All in One", "Sub Notebook", 17 "Space-saving", "Lunch Box", "Main Server Chassis", "Expansion Chassis", 18 "SubChassis", "Bus Expansion Chassis", "Peripheral Chassis", 19 "RAID Chassis", "Rack Mount Chassis", "Sealed-case", "Multi-system chassis" 20 ) ; 21 22 @memform = ( "", "", "", "SIMM", "SIP", "Chip", "DIP", "ZIP", "Proprietary card", 23 "DIMM", "TSOP", "Row of chips", "RIMM", "SODIMM", "SRIMM"); 24 25 @memtype = ( "", "", "", "DRAM", "EDRAM", "VRAM", "SRAM", "RAM", "ROM", 26 "FLASH", "EEPROM", "FEPROM", "EPROM", "CDRAM", "3DRAM", "SDRAM", 27 "SGRAM", "RDRAM", "DDR", "DDR2"); 28 29 @memdetails = ( "", "", "", "Fast-paged", "Static column", "Pseudo-static", 30 "RAMBUS", "Synchronous", "CMOS", "EDO", "Window DRAM", "Cache DRAM", 31 "Non-volatile" ); 9 32 10 33 # Program … … 125 148 { 126 149 my ($toto,$freq)=split(/:/); 127 $freq= $freq/1000;150 $freq=int($freq/1000 + 0.5); 128 151 print "Freq=$freq\n"; 129 152 next; … … 141 164 chomp($sys); 142 165 print "System=$sys\n"; 166 next; 167 } 168 if (/^S3:/) 169 { 170 my ($t,$sys)=split(/:/); 171 chomp($sys); 172 my ($fac, $type)=split(/\|/, $sys); 173 $typename = "Unknown"; 174 if ($type >= 1 && $type <= 26) { $typename = $typetbl[$type]; } 175 print "Chassis=$fac|$typename\n"; 176 next; 177 } 178 if (/^S4:/) 179 { 180 my ($t,$sys)=split(/:/); 181 chomp($sys); 182 print "CpuNum=$sys\n"; 143 183 next; 144 184 } … … 167 207 if (($list[2] eq 'a')) {print "Model=Pentium III Xeon\n";next;} 168 208 if (($list[2] eq 'b')) {print "Model=Pentium III 0.13u\n";next;} 209 if (($list[2] eq 'd')) {print "Model=Pentium M 0.09u\n";next;} 169 210 print "Model=Pentium Pro/II/III\n"; 170 211 next; 171 212 } 172 213 if (($list[1] eq '7')) {print "Model=Itanium\n";next;} 173 if (($list[1] eq 'f')) {print "Model=Pentium 4\n";next;} 214 if (($list[1] eq 'f')) { 215 if ($list[2] == '0') {print "Model=Pentium 4 0.18u\n";next;} 216 if ($list[2] == '1') {print "Model=Pentium 4 0.18u\n";next;} 217 if ($list[2] == '2') {print "Model=Pentium 4 0.13u\n";next;} 218 if ($list[2] == '3') {print "Model=Pentium 4 0.09u\n";next;} 219 if ($list[2] == '4') {print "Model=Pentium 4 0.09u\n";next;} 220 print "Model=Pentium 4\n";next; 221 } 174 222 print "Model=???\n"; 175 223 next; … … 183 231 if ($list[2] == '1') {print "Model=Athlon 0.25u Slot A\n";next;} 184 232 if ($list[2] == '2') {print "Model=Athlon 0.18u Slot A\n";next;} 185 if ($list[2] == '3') {print "Model=Duron \n";next;}186 if ($list[2] == '4') {print "Model=Athlon 0.18u\n";next;}233 if ($list[2] == '3') {print "Model=Duron (SF core)\n";next;} 234 if ($list[2] == '4') {print "Model=Athlon (TB core) 0.18u\n";next;} 187 235 if ($list[2] == '6') {print "Model=Athlon MP/Mobile Athlon\n";next;} 188 236 if ($list[2] == '7') {print "Model=Mobile Duron\n";next;} 237 if ($list[2] == '8') {print "Model=Athlon (TH/AP core)\n";next;} 238 if ($list[2] == 'a') {print "Model=Athlon (BT core)\n";next;} 189 239 print "Model=Athlon/Duron\n"; 190 240 next; 191 241 } 192 if (($list[1] == 'f')) {print "Model=Opteron/Athlon 64\n";next;}242 if (($list[1] == 'f')) {print "Model=Opteron/Athlon 64\n";next;} 193 243 print "Model=???\n"; 194 244 next; … … 196 246 if ($list[13] == '43') 197 247 { 198 print "CpuVendor=Cyrix\n"; 248 print "CpuVendor=Cyrix/Via\n"; 249 if (($list[1] == '5')) {print "Model=Cyrix M1/Media GX\n";next;} 250 if (($list[1] == '6')) { 251 if ($list[2] == '5') {print "Model=Cyrix M2\n";next;} 252 print "Model=Via C3\n";next; 253 } 199 254 print "Model=???\n"; 200 255 next; … … 241 296 } 242 297 298 243 299 sub hdmap 244 300 { … … 259 315 close(INFO); 260 316 } 317 318 sub mem 319 { 320 my $file=$_[0]; 321 my $i=0; 322 323 open(FILE,$file) or die; 324 while (<FILE>) 325 { 326 next unless /^SM:/; 327 328 my @list=split(/[:(),=]+/); 329 my $used = ($list[1] ne "0")+0; 330 my $size = $list[1]; 331 if ($size > 0) { 332 $size *= 1024; 333 } else { 334 $size *= -1; 335 } 336 print "\n[MEM$i]\n"; 337 print "Used=$used\n"; 338 print "Capacity=$size\n" if ($used); 339 print "Form=".$memform[hex($list[2])]."\n"; 340 print "Location=".$list[3]."\n"; 341 my $details = ""; 342 my $bit = 1; 343 my $data = hex($list[4]) >> 16; 344 foreach $det (@memdetails) { 345 if ($data & $bit) { 346 $details .= " ".$det; 347 } 348 $bit *= 2; 349 } 350 print "Type=".$memtype[hex($list[4]) & 0xFFFF]."$details\n"; 351 print "Speed=$list[5]\n" if ($list[5] != 0); 352 $i++; 353 } 354 close(FILE); 355 } 356 261 357 262 358 # MAIN … … 285 381 disk($ARGV[0]); 286 382 hdmap($ARGV[0]); 383 mem($ARGV[0]); 287 384 288 385 # update the database if LRS Inventory is installed
