#!/bin/sh os=`uname` if [ "$os" != "SunOS" ] then zeig="echo -e" else zeig="echo" fi $zeig '\033[47m '; tput sgr0 $zeig '\033[47m ''\033[28;44m##########################################''\033[47m '; tput sgr0 $zeig '\033[47m ''\033[28;44m######''\033[4;28;44m System Check Tool by ®eini ''\033[0;28;44m########''\033[47m '; tput sgr0 $zeig '\033[47m ''\033[28;44m##########################################''\033[47m '; tput sgr0 $zeig '\033[47m '; tput sgr0 if [ "$os" = "Linux" ] then if [ "$1" = "" ] then $zeig '\033[28;44m-all shows all available infos';tput sgr0 $zeig '\033[28;44m-cpu shows all available infos from CPU';tput sgr0 $zeig '\033[28;44m-pci shows all available infos from PCI';tput sgr0 $zeig '\033[28;44m-int shows all available infos from Interrupts';tput sgr0 $zeig '\033[28;44m-iop shows all available infos from ioports';tput sgr0 $zeig '\033[28;44m-iom shows all available infos from iomemory';tput sgr0 $zeig '\033[28;44m-dis shows all available infos from Disks';tput sgr0 $zeig '\033[28;44m-net shows all available infos from Net';tput sgr0 $zeig '\033[28;44m-acc shows all available infos from Net Access';tput sgr0 exit fi test -d /tmp/.syscheck error=`echo $?` if [ $error -eq 1 ] then mkdir /tmp/.syscheck fi if [ "$1" = "-all" ]||[ "$1" = "-cpu" ] then $zeig '\033[28;44m###### Processor-Information###'; tput sgr0 echo "" cat /proc/cpuinfo echo "" if [ "$1" = "-cpu" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-pci" ] then $zeig '\033[28;44m###### System-Information ###';tput sgr0 echo "" cat /proc/pci echo "" if [ "$1" = "-pci" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-int" ] then $zeig '\033[28;44m###### Interrupt-Information###'; tput sgr0 echo "" cat /proc/interrupts echo "" if [ "$1" = "-int" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-iop" ] then $zeig '\033[28;44m###### IO-Port-Information ###'; tput sgr0 echo "" cat /proc/ioports echo "" if [ "$1" = "-iop" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-iom" ] then $zeig '\033[28;44m###### IO-Memory-Information ###'; tput sgr0 echo "" cat /proc/iomem echo "" if [ "$1" = "-iom" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-dis" ] then sfdisk -sg > /tmp/.syscheck/.sfdisk while read sfdisk do dev1=`echo $sfdisk|cut -f2 -d"/"` if [ "$dev1" = "dev" ] then echo $sfdisk|cut -f1 -d":" > /tmp/.syscheck/.devusort sort -u /tmp/.syscheck/.devusort > /tmp/.syscheck/.devsort fi done < /tmp/.syscheck/.sfdisk $zeig '\033[28;44m###### Harddisks ######'; tput sgr0 echo "" while read devsort do ide_info $devsort sfdisk -g $devsort hdparm $devsort df |grep $devsort done < /tmp/.syscheck/.devsort echo "" if [ "$1" = "-dis" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-net" ] then $zeig '\033[28;44m###### Netzwerk-Devices####'; tput sgr0 mii-tool|cut -f1 -d":" > /tmp/.syscheck/.eth while read eth do echo "" ifconfig $eth mii-tool -v $eth done < /tmp/.syscheck/.eth if [ "$1" = "-net" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-acc" ] then $zeig '\033[28;44m###### Netzwerk-Access####'; tput sgr0 netstat -ap|grep ESTABLISHED if [ "$1" = "-acc" ] then exit fi fi fi if [ "$os" = "SunOS" ] then if [ "$1" = "" ] then $zeig '\033[28;44m-all shows all available infos';tput sgr0 $zeig '\033[28;44m-cpu shows all available infos from CPU';tput sgr0 $zeig '\033[28;44m-sys shows all available infos from system';tput sgr0 $zeig '\033[28;44m-dis shows all available infos from Disks';tput sgr0 $zeig '\033[28;44m-net shows all available infos from Net-Devices';tput sgr0 exit fi test -d /tmp/.syscheck error=`echo $?` if [ $error -eq 1 ] then mkdir /tmp/.syscheck fi if [ "$1" = "-all" ]||[ "$1" = "-cpu" ] then $zeig '\033[28;44m###### Processor-Information###'; tput sgr0 echo "" psrinfo -vv /usr/platform/sun4u/sbin/prtdiag -v echo "" if [ "$1" = "-cpu" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-sys" ] then $zeig '\033[28;44m###### System-Information###'; tput sgr0 prtconf -V > /tmp/.syscheck/.sys prtconf -vpD >> /tmp/.syscheck/.sys cat /tmp/.syscheck/.sys if [ "$1" = "-sys" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-dis" ] then $zeig '\033[28;44m###### Disks-Information###'; tput sgr0 echo "" echo "disk" > /tmp/.syscheck/.steuer echo "0" >> /tmp/.syscheck/.steuer echo "q" >> /tmp/.syscheck/.steuer format -f /tmp/.syscheck/.steuer 2>/dev/null|grep hd|cut -f2 -d"."|cut -c2-|cut -f1 -d" " > /tmp/.syscheck/.disks while read dis do prtvtoc /dev/dsk/$dis"s2" done < /tmp/.syscheck/.disks if [ "$1" = "-dis" ] then exit fi fi if [ "$1" = "-all" ]||[ "$1" = "-net" ] then $zeig '\033[28;44m###### Net-Devices-Information###'; tput sgr0 echo "" ifconfig -a|grep hme|cut -c4 > /tmp/.syscheck/.net while read net do ifconfig hme$net ndd -set /dev/hme instance $net echo "Card-Status of Card hme"$net echo "" line=`ndd -get /dev/hme transciever_inuse` if [ "$line" = "0" ] then echo "Card hme"$net "is offline(mii)" else echo "Card hme"$net "is online(mii)" fi online=`ndd -get /dev/hme link_status` if [ "$online" = "0" ] then echo "Link from Card hme"$net "is off" else echo "Link from Card hme"$net "is on" fi speed=`ndd -get /dev/hme link_speed` if [ "$speed" = "0" ] then echo "Speed of hme"$net "= 10mbit" else echo "Speed of hme"$net "= 100mbit" fi duplex=`ndd -get /dev/hme link_mode` if [ "$duplex" = "0" ] then echo "Card hme"$net "is set to half-duplex" else echo "Card hme"$net "is set to full-duplex" fi echo "" echo "Advertise Modus" autoneg=`ndd -get /dev/hme adv_autoneg_cap` if [ "$autoneg" = "0" ] then echo "Advertise auto negotiate capability = off" else echo "Advertise auto negotiate capability = on" fi a=`ndd -get /dev/hme adv_100fdx_cap` if [ "$a" = "0" ] then echo "Advertise 100Mbit full duplex capability = off" else echo "Advertise 100Mbit full duplex capability = on" fi b=`ndd -get /dev/hme adv_100hdx_cap` if [ "$b" = "0" ] then echo "Advertise 100Mbit half duplex capability = off" else echo "Advertise 100Mbit half duplex capability = on" fi c=`ndd -get /dev/hme adv_100T4_cap` if [ "$c" = "0" ] then echo "Advertise deprecated 100Mbit T4 capability = off" else echo "Advertise deprecated 100Mbit T4 capability = on" fi d=`ndd -get /dev/hme adv_10fdx_cap` if [ "$e" = "0" ] then echo "Advertise 10Mbit full duplex capability = off" else echo "Advertise 10Mbit full duplex capability = on" fi e=`ndd -get /dev/hme adv_10hdx_cap` if [ "$e" = "0" ] then echo "Advertise 10Mbit half duplex capability = off" else echo "Advertise 10Mbit half duplex capability = on" fi echo "" echo "Link Partner Status" f=`ndd -get /dev/hme lp_autoneg_cap` if [ "$f" = "0" ] then echo "Advertise auto negotiate capability = off" else echo "Advertise auto negotiate capability = on" fi g=`ndd -get /dev/hme lp_100fdx_cap` if [ "$g" = "0" ] then echo "Advertise 100Mbit full duplex capability = off" else echo "Advertise 100Mbit full duplex capability = on" fi h=`ndd -get /dev/hme lp_100hdx_cap` if [ "$h" = "0" ] then echo "Advertise 100Mbit half duplex capability = off" else echo "Advertise 100Mbit half duplex capability = on" fi i=`ndd -get /dev/hme lp_100T4_cap` if [ "$i" = "0" ] then echo "Advertise deprecated 100Mbit T4 capability = off" else echo "Advertise deprecated 100Mbit T4 capability = on" fi j=`ndd -get /dev/hme lp_10fdx_cap` if [ "$j" = "0" ] then echo "Advertise 10Mbit full duplex capability = off" else echo "Advertise 10Mbit full duplex capability = on" fi k=`ndd -get /dev/hme lp_10hdx_cap` if [ "$k" = "0" ] then echo "Advertise 10Mbit half duplex capability = off" else echo "Advertise 10Mbit half duplex capability = on" fi done < /tmp/.syscheck/.net if [ "$1" = "-net" ] then exit fi fi fi