I have been fooling around with this script, try it out and improve it,
which won't be difficult....

Watch wrap!!!

###################### cut below here #############################
#!/bin/sh
# RaQware - Gerald Waugh
# Outputs server hardware stats.
$TEST
TEST=`ifconfig eth0 | grep "inet addr" | cut -f 2 -d":" | cut -f 1 -d" "`
echo $TEST >  server-stats
TEST=`cmos -c romrev`
echo "ROM VERSION - $TEST" >> server-stats
uname -a | cut -f 1 -d "#"  >> server-stats
echo ""
echo "########## Ethernet Ports ##########"  >> server-stats
echo -n "eth0: "  >> server-stats
TEST=`cat /proc/ioports | grep Speedo`
if [ -n "$TEST" ]; then
 cat /proc/ioports | cut -f 2 -d ":"  | grep Intel
>> server-stats
 TEST=`cat /proc/ioports | grep 6240`
 if [ -n "$TEST" ]; then
   echo -n "eth1: "  >> server-stats
   cat /proc/ioports | cut -f 2 -d ":"  | grep Intel
>> server-stats
 fi
else
  TEST=`cat /proc/ioports | grep fd80`
  if [ -n "$TEST" ]; then
    cat /proc/ioports | grep fd80 | cut -f 2 -d ":"
| grep Intel >> server-stats
  else
    cat /proc/ioports | grep ff80 | cut -f 2 -d ":" | grep Intel >> server-stats
  fi
fi
TEST=`cat /proc/ioports | grep "#2"`
if [ -n "$TEST" ]; then
  echo -n "eth1: "  >> server-stats
  cat /proc/ioports | grep fd40 | cut -f 2 -d ":" | grep Intel >> server-stats
fi
TEST=`cat /proc/ioports | grep Symbios | cut -f 2 -d ":"`
if [ -n "$TEST" ]; then
  echo "########## SCSI Port ##########"  >>
server-stats
  echo "SCSI: $TEST"  >> server-stats
fi
echo "########## Serial Ports ##########"  >> server-stats
echo -n "ttyS0: " >> server-stats
cat /proc/ioports | grep 3f8 | cut -f 2 -d ":" >> server-stats
echo -n "ttyS1: " >> server-stats
cat /proc/ioports | grep 2f8 | cut -f 2 -d ":" >> server-stats
echo "########## Hard Drive Info #########" >> server-stats
echo -n "hda: "  >> server-stats
cat /proc/ide/hda/model >> server-stats
if [ -f "/proc/ide/hdc/model" ]; then
 echo -n "hdc: " >> server-stats
 cat /proc/ide/hdc/model >> server-stats
fi
df -h >> server-stats
echo "########## RAID Status #########" >> server-stats
cat /proc/mdstat | grep md1 >> server-stats
cat /proc/mdstat | grep md2 >> server-stats
cat /proc/mdstat | grep md3 >> server-stats
cat /proc/mdstat | grep md4 >> server-stats
echo "########## CPU Info #########" >> server-stats
cat /proc/cpuinfo | grep "model name" >> server-stats
cat /proc/cpuinfo | grep "cpu MHz" >> server-stats
cat /proc/cpuinfo | grep "cache size" >> server-stats
echo "########## MEM Info #########" >> server-stats
cat /proc/meminfo | grep MemTotal: >> server-stats
cat server-stats | mail -s "$IPADDR stats" admin
###################### cut above here #############################

Gerald
--
http://frontstreetnetworks.com | http://raqware.com
  Front Street Networks LLC, 229 Front Street, Ste.#C
  New Haven, CT 06513-3203 | phone: +1-203-785-0699
_______________________________________________
Cobaltfacts site list
[email protected]
http://list.cobaltfacts.com/mailman/listinfo.cgi/cobaltfacts

Reply via email to