 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY | sysinfo for linux? Is there an equiv. of Sun's sysinfo for linux? I want to have a central webpage describing each machine in my network. This is easy to do in Windows using WMI and I've used sysinfo to do it on Sun's but what's the best way to do it with linux? |
|
|
|
 davidsmindThe Eye's MindPremium join:2001-07-04 Canada | Have a look in the /proc directory  |
|
 chknlil join:2000-04-02 Kansas City, MO | reply to sadowski I don't think that's really what he is looking for, but I don't think there is a tool that comes with Linux that will do what he wants. Maybe have to download another opensource tool to get the job done. I think you want something similar to prtdiag, but I'm not aware of any tool like that for linux. -- "I sense much NT in you. NT leads to bluescreen, bluescreen leads to downtime, downtime leads to suffering. NT is the path to the darkside. Powerful Unix is." |
|
 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY | Yeah, this is the kind of thing you get with sysinfo on a Sun (not all of it but based on it), »bfn.org/admin/bfn/hardware.html (oops, I haven't updated it in 3 years. ) Have to add that to my to-do list. And this is an example from Windows, »www.paulsadowski.com:81/systeminfo.htm but I just started that, haven't finished or decided what all I want in it. |
|
 DenPremium join:2001-01-21 Cape Coral, FL |
code:
#!/bin/sh #requires the following # free, hostname, grep, cut, awk, uname
HOSTNAME=`hostname -s` IP_ADDRS=`ifconfig | grep 'inet addr' | grep -v '255.0.0.0' | cut -f2 -d':' | awk '{print $1}'` IP_ADDRS=`echo $IP_ADDRS | sed 's/\n//g'`
#memory MEMORY=`free | grep Mem | awk '{print $2}'`
#cpu info CPUS=`cat /proc/cpuinfo | grep processor | wc -l | awk '{print $1}'` CPU_MHZ=`cat /proc/cpuinfo | grep MHz | tail -n1 | awk '{print $4}'` CPU_TYPE=`cat /proc/cpuinfo | grep vendor_id | tail -n 1 | awk '{print $3}'` CPU_TYPE2=`uname -m`
OS_NAME=`uname -s` OS_KERNEL=`uname -r` BOOT=`procinfo | grep Bootup | sed 's/Bootup: //g' | cut -f1-6 -d' '` UPTIME=`uptime | cut -f5-8 -d' '`
PCIINFO=`lspci | cut -f3 -d':'` #Another way to do it #PCIINFO=`lspci | cut -f3 -d':'`
#print it out echo "$HOSTNAME" echo "----------------------------------" echo "Hostname : $HOSTNAME" echo "Host Address(es) : $IP_ADDRS" echo "Main Memory : $MEMORY" echo "Number of CPUs : $CPUS" echo "CPU Type : $CPU_TYPE $CPU_TYPE2 $CPU_MHZ MHz" echo "OS Name : $OS_NAME" echo "Kernel Version : $OS_KERNEL" echo "Bootup : $BOOT - Uptime $UPTIME" echo echo "Devices" echo "----------------------------------" echo "$PCIINFO"
Which will give you something like
code:
viper ---------------------------------- Hostname : viper Host Address(es) : 192.168.0.1 xx.xx.xx.xx Main Memory : 513380 Number of CPUs : 2 CPU Type : GenuineIntel i686 525.014 MHz OS Name : Linux Kernel Version : 2.4.17 Bootup : Sat Dec 22 17:04:27 2001 - Uptime 3 days, 6:28, ~ Devices ---------------------------------- 00:00.0 Host bridge: Intel Corporation 440BX/ZX - 82443BX/ZX Host bridge (rev 03) 00:01.0 PCI bridge: Intel Corporation 440BX/ZX - 82443BX/ZX AGP bridge (rev 03) 00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02) 00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01) 00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01) 00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 02) 00:09.0 Ethernet controller: Bridgecom, Inc: Unknown device 0985 (rev 11) 00:0b.0 Multimedia audio controller: Creative Labs SB Live! EMU10000 (rev 04) 00:0b.1 Input device controller: Creative Labs SB Live! (rev 01) 00:0d.0 SCSI storage controller: Adaptec AIC-7881U (rev 01) 00:0f.0 Multimedia video controller: 3Dfx Interactive, Inc. Voodoo 2 (rev 02) 00:13.0 Unknown mass storage controller: HighPoint Technologies, Inc. HPT366/370 UltraDMA 66/100 IDE Controller (rev 01) 00:13.1 Unknown mass storage controller: HighPoint Technologies, Inc. HPT366/370 UltraDMA 66/100 IDE Controller (rev 01) 01:00.0 VGA compatible controller: nVidia Corporation Riva TnT 128 [NV04] (rev 04)
Den |
|
 thorgodI've modeled explosions, BIG explosions join:2001-07-30 Las Vegas, NV | reply to sadowski Well, I know the output is sort of cryptic, but check out lspci. It will at least tell you about all the stuff you have on PCI channels. Also, swapon -s show's swap ussage, so I guess the general idea here is you need to figure out what information you want to display and find the tools that will tell you that. -- "Unix gives you enough rope to shoot yourself in the foot." |
|
 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY | reply to Den Very nice! Thank you! |
|
 thorgodI've modeled explosions, BIG explosions join:2001-07-30 Las Vegas, NV | reply to Den I just tested that code out, nice man I think I'll be making good use of this! -- "Unix gives you enough rope to shoot yourself in the foot." |
|
 DenPremium join:2001-01-21 Cape Coral, FL | reply to sadowski That'll get you going and show you the basics on how to parse the stuff.
If your looking for a command and you don't now the name of it, but would like to search the man pages for a key word you can do something like:
man -k [word to search for] | less
Example: man -k pci | less
would show you something like:
code:
airo (4) - Driver for the Aironet 802.11 ISA/PCI/PCMCIA 4500 & 4800 and Cisco 340 lspci (8) - list all PCI devices pcinitrd (8) - create a PCMCIA initrd ram disk image pcitweak (1x) - read/write PCI config space rpcinfo (8) - report RPC information scanpci (1x) - scan/probe PCI buses setpci (8) - configure PCI devices airo (4) - Driver for the Aironet 802.11 ISA/PCI/PCMCIA 4500 & 4800 and Cisco 340 lspci (8) - list all PCI devices pcinitrd (8) - create a PCMCIA initrd ram disk image setpci (8) - configure PCI devices
I quick peek shows something like 'lspci' that you can either check out with man or try.
Den |
|
 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY
| reply to thorgod Yeah I guess I was just being lazy. [text was edited by author 2001-12-26 00:14:08] |
|
 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY
| reply to Den That's odd, I have man pages for lspci and ifconfig but I don't seem to actually have them. I'm running find now looking for them.
Thanks again.
Edit: Oops, /sbin isn't in my path. <blush> [text was edited by author 2001-12-26 00:27:22] |
|
 DenPremium join:2001-01-21 Cape Coral, FL | Sounds like your maybe your path
>which lspci /sbin/lspci
Then if your using rpm you can find out what package >rpm -qf /sbin/lspci pciutils-2.1.8-23
Then list the files in the package >rpm -ql pciutils /sbin/lspci /sbin/setpci /usr/share/doc/pciutils-2.1.8 /usr/share/doc/pciutils-2.1.8/ChangeLog /usr/share/doc/pciutils-2.1.8/README /usr/share/doc/pciutils-2.1.8/pciutils.lsm /usr/share/man/man8/lspci.8.gz /usr/share/man/man8/setpci.8.gz /usr/share/pci.ids
Den |
|
 sadowskiI Am My Own DoppelgangerPremium,MVM join:2000-04-14 Buffalo, NY | Right just found them. How embarrassing.  |
|
 chknlil join:2000-04-02 Kansas City, MO | reply to Den Hey Nice little script! Thanks. |
|
 | reply to sadowski Nice piece of work Den. I will be using this one often. I set all the code in a file and turned it into an exe that I can run anytime, anywhere. |
|
 DenPremium join:2001-01-21 Cape Coral, FL | said by dbolton: and turned it into an exe
<cringe*>
Not trying to be picky or a smart @ss, but you mean you made it executable. 
*to flinch, as from pain lol
Den |
|
 chknlil join:2000-04-02 Kansas City, MO | reply to sadowski LOL!!! |
|