Procinfo gathers system data from /proc and prints it to the screen. The program has been around since the infancy of Linux. There are some patches for procinfo here. Now, Red Hat has been patching this for a long time. Here is a change log for the current patches. The original sources were a bit more difficult to find, and can be found here. Here is a picture of the guy that wrote procinfo:
It took me such a long time to find the original author of procinfo that I felt compelled to put up a picture. So much better than the lists of random people from Red Hat in the SPEC file and the out of date URL. Click on the picture for more info on Sander. He is in a Dutch garage band that is very enjoyable. You can listen to some of their music here. In fact, I highly recommend, if you are following along and compiling this, that you turn on some of the tunes from 1-2-5. It really brightened my day, dear reader.
OK. Some systems don’t have RPM, and so what we need to do is extract the patches and source from the RPM and apply the patches:
# tar -xjf procinfo-18.tar.bz2 # cd procinfo-18 # patch -p1 ../procinfo-14-misc.patch # patch -Np1 -i ../procinfo-14-misc.patch patching file Makefile # patch -Np1 -i ../procinfo-17-mandir.patch patching file Makefile # patch -Np1 -i ../procinfo-17-uptime.patch patching file routines.c # patch -Np1 -i ../procinfo-17-lsdev.patch patching file lsdev.pl # patch -Np1 -i ../procinfo-18-acct.patch patching file procinfo.c patching file procinfo.h # patch -Np1 -i ../procinfo-18-mharris-use-sysconf.patch patching file procinfo.c # patch -Np1 -i ../procinfo-18-maxdev.patch patching file procinfo.h patching file procinfo.c # patch -Np1 -i ../procinfo-18-ranges.patch patching file procinfo.c # patch -Np1 -i ../procinfo-18-cpu-steal.patch patching file procinfo.h patching file procinfo.8 patching file procinfo.c |
Now, let’s tar the whole thing up and re-extract in /usr/local/src:
# tar -czf procinfo-18.2.2.tar.gz procinfo-18.2.2 # # mv procinfo-18.2.2.tar.gz /usr/local/src # cd /usr/local/src # tar -xzf procinfo-18.2.2.tar.gz |
We put a copy of the patched 18.2.2 tarball up here. Let’s compile and install:
cd procinfo-18.2.2 mkdir /usr/man/man8/ make LDLIBS=-lncurses && make install gcc -Wall -Wstrict-prototypes -c -o procinfo.o procinfo.c procinfo.c:19: warning: 'rcsid' defined but not used gcc -Wall -Wstrict-prototypes -c -o routines.o routines.c routines.c:19: warning: 'rcsid' defined but not used gcc -Wall -Wstrict-prototypes -s procinfo.o routines.o -lncurses -o procinfo mkdir -p /usr/bin install -m 755 procinfo /usr/bin/procinfo install -m 755 lsdev.pl /usr/bin/lsdev install -m 755 socklist.pl /usr/bin/socklist mkdir -p /usr/man install -m 644 procinfo.8 /usr/man/man8/procinfo.8 install -m 644 lsdev.8 /usr/man/man8/lsdev.8 install -m 644 socklist.8 /usr/man/man8/socklist.8 # |
Here is how procinfo looks on a CentOS 4 system:
# procinfo Linux 2.6.9-34.EL (buildcentos@build-i386) (gcc 3.4.5 20051201 ) #1 1CPU [main] Memory: Total Used Free Shared Buffers Mem: 507988 467512 40476 0 138968 Swap: 2096472 156 2096316 Bootup: Sat May 13 10:47:08 2006 Load average: 0.01 0.02 0.00 1/62 31761 user : 10:12:38.12 1.3% page in : 0 nice : 0:02:36.30 0.0% page out: 0 system: 6:06:46.95 0.8% swap in : 0 idle : 32d 9:33:49.50 97.9% swap out: 0 steal : 0:00:00.00 0.0% uptime: 33d 1:51:43.64 context : 74975717 irq 0:2858585398 timer irq 8: 1 rtc irq 1: 2 irq 11: 53900252 eth0 irq 2: 0 cascade [4] irq 12: 3 irq 4: 1 irq 14: 4033195 ide0 |
Here is procinfo running with the -f option, which runs continuously:
bash-2.05a# procinfo -f Linux 2.4.32 (root@mcj) (gcc 3.2.1) #3 Tue Jun 13 15:18:04 PDT 2006 1CPU [mcj] Memory: Total Used Free Shared Buffers Cached Mem: 1032656 1018076 14580 0 43184 829536 Swap: 498004 0 498004 Bootup: Wed Jun 14 06:56:57 2006 Load average: 0.99 0.43 0.16 2/40 35923 user : 0:43:36.76 3.2% page in : 573821 disk 1: 72514r 60790w nice : 0:00:00.00 0.0% page out: 1948028 system: 0:05:42.06 0.4% swap in : 1 idle : 22:11:05.21 96.4% swap out: 0 steal : 0:00:00.00 0.0% uptime: 23:00:24.02 context : 3806075 irq 0: 8282403 timer irq 12: 44010 PS/2 Mouse irq 1: 4609 keyboard irq 14: 132790 ide0 irq 2: 0 cascade [4] irq 15: 7 ide1 irq 6: 3 irq 18: 87754 eth0 irq 7: 1 |
The above is on a MCJ Root Filesystem, which is just a very plain, vintage 2003 GNU/Linux system that is easy to build yourself. The -a option gives even more details.
# procinfo -a Linux 2.4.32 (root@mcj) (gcc 3.2.1) #3 Tue Jun 13 15:18:04 PDT 2006 1CPU [mcj] Memory: Total Used Free Shared Buffers Cached Mem: 1032656 996204 36452 0 43876 815816 Swap: 498004 0 498004 Bootup: Wed Jun 14 06:56:57 2006 Load average: 0.01 0.01 0.00 2/27 4801 user : 0:45:19.03 3.1% page in : 579609 disk 1: 73286r 62750w nice : 0:00:00.00 0.0% page out: 2018036 system: 0:05:48.32 0.4% swap in : 1 idle : 23:51:14.17 96.6% swap out: 0 steal : 0:00:00.00 0.0% uptime: 1d 0:42:21.52 context : 3955630 irq 0: 8894152 timer irq 12: 44010 PS/2 Mouse irq 1: 4609 keyboard irq 14: 135517 ide0 irq 2: 0 cascade [4] irq 15: 7 ide1 irq 6: 3 irq 18: 90212 eth0 irq 7: 1 Kernel Command Line: BOOT_IMAGE=linux ro root=/dev/hda3 Character Devices: Block Devices: 1 mem 10 misc 2 fd 2 pty 128 ptm 3 ide0 3 ttyp 136 pts 22 ide1 4 ttyS 162 raw 5 cua 226 drm 7 vcs File Systems: [rootfs] [bdev] [proc] [sockfs] [tmpfs] [shm] [pipefs] [binfmt_misc] ext3 ext2 [ramfs] iso9660 [nfs] [autofs] [devpts] # |