You are not logged in.

#1 2007-09-20 21:53:54

crouse
Arch Linux f@h Team Member
From: Iowa - USA
Registered: 2006-08-19
Posts: 907
Website

Arch System Info script

I log into alot of different arch machines, and wanted to have a script that i could run to quickly give me some data on the machine I'm on. (Hey, I'm forgetful) tongue
Output looks like :

ARCH LINUX - Machine Information Script ver .10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DATE: 09/20/07 04:36:08 PM   MACHINE NAME: localhost

Eth0: Local IP:192.168.0.8  Bcast:192.168.0.255  Mask:255.255.255.0
ETHERNET CARD: Intel Corporation 82557/8/9 Ethernet Pro 100 (rev 0c)
CPU INFO: Qty=2 i686 Intel(R) Xeon(TM) CPU 1.70GHz
VIDEO CARD: nVidia Corporation NV15GL [Quadro2 Pro] (rev a4)
AUDIO CONTROLLER: Intel Corporation 82801BA/BAM AC'97 Audio Controller (rev 04)
RAM INFO: 515752 kB

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DISK USAGE:
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda3             113G   68G   39G  64% /
none                  252M     0  252M   0% /dev/shm
/dev/hda1              32M   18M   13M  59% /boot
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UPTIME:  16:36:08 up 8 days,  4:15,  1 user,  load average: 0.06, 0.02, 0.03
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
# by Crouse - usalug.org 09-12-2007 
clear
num_cpus=`cat /proc/cpuinfo | grep -c "model name"`
machine_cpu=`cat /proc/cpuinfo | grep -m 1 "model name" | cut -d: -f2`
machine_mhz=`cat /proc/cpuinfo | grep -m 1 "cpu MHz" | cut -d: -f2`
machine_cpuinfo=`uname -mp`
todays_date=`date +"%D %r"`
machine_uptime=`uptime`
machine_ram=`cat /proc/meminfo | grep -m 1 "MemTotal:" | cut -d: -f2 |  sed 's/^[ \t]*//'`
machine_video=`lspci | grep -m 1 "VGA" | cut -d: -f3 |  sed 's/^[ \t]*//'`
machine_eth_card=`lspci | grep -m 1 "Ethernet" | cut -d: -f3 |  sed 's/^[ \t]*//'`
machine_audio_controller=`lspci | grep -m 1 "audio" | cut -d: -f3 |  sed 's/^[ \t]*//'`
arch_damons=`grep "DAEMONS=" /etc/rc.conf `
last_logins=`last | head`
eth0info=`ifconfig eth0 | grep "inet addr:" | sed 's/inet addr/Local IP/g' | sed 's/^[ \t]*//;s/[ \t]*$//'`

echo "ARCH LINUX - Machine Information Script ver .10"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "DATE: $todays_date   MACHINE NAME: $HOSTNAME  "
echo " "
echo "Eth0: $eth0info"
echo "ETHERNET CARD: $machine_eth_card"
echo "CPU INFO: Qty=$num_cpus $machine_cpuinfo"
echo "VIDEO CARD: $machine_video"
echo "AUDIO CONTROLLER: $machine_audio_controller"
echo "RAM INFO: $machine_ram" 
echo " "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
route
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "DISK USAGE:"
df -h
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "UPTIME: $machine_uptime"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# echo "LAST LOGINS:"; echo $last_logins
# echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "$arch_damons"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit 0

Not perfect, but gives me what I need quickly. Thought I'd share.

Offline

#2 2007-09-20 22:55:53

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Arch System Info script

Wow! Very nice... thanks for this!


thayer williams ~ cinderwick.ca

Offline

#3 2007-09-20 23:57:01

ramoneur
Member
Registered: 2007-06-04
Posts: 89

Re: Arch System Info script

nice nice! will come in handy! big_smile


A w e s o m e
r
c
h

Offline

#4 2007-09-26 03:11:31

sabooky
Member
Registered: 2006-11-02
Posts: 89

Re: Arch System Info script

nice...simple....and awesome, thanks!
It's like CLI conky.

Offline

Board footer

Powered by FluxBB