[SunHELP] Health Check scripts

DevrimY at garanti.com.tr DevrimY at garanti.com.tr
Thu Feb 5 08:23:50 CST 2004


Hi;
you can check this site...
http://www.sun.com/bigadmin/scripts/

dEVRim*


-----Original Message-----
From: sunhelp-bounces at sunhelp.org [mailto:sunhelp-bounces at sunhelp.org]On
Behalf Of Brad Blix
Sent: Thursday, February 05, 2004 4:16 PM
To: The SunHELP List
Subject: Re: [SunHELP] Health Check scripts


Here is the script I use. It gives most of what you are looking for and
you should be able to add what is missing fairly easily.

Brad

#!/bin/sh

HOST=`/bin/hostname`
MANAGER="you at yourdomain.com"
NOW=`/bin/date`
LOG="/tmp/dailystatus"
MOUNTPOINT="/usr/local/tripwire"
CDDEVICE="/dev/dsk/c0t6d0s2"

/bin/echo "$HOST Daily Status     $NOW" > $LOG
/bin/echo >> $LOG
/bin/echo >> $LOG
/bin/echo "**********  Login History  **********" >> $LOG
/bin/echo >> $LOG
last | head -25 >> $LOG
/bin/echo >> $LOG
/bin/echo "**********  Auth Log **********" >> $LOG
/bin/echo >> $LOG
tail -25 /var/log/authlog >> $LOG
/bin/echo >> $LOG
/bin/echo >> $LOG
/bin/echo "**********  Disk Space  **********" >> $LOG
/bin/echo >> $LOG
/bin/echo "Filesystem            kbytes    used   avail capacity
Mounted on" >> $LOG
/bin/df -k | /bin/grep /dsk/ >> $LOG
/bin/echo >> $LOG
/bin/echo >> $LOG
if [ -f /usr/platform/`uname -i`/sbin/prtdiag ]; then
       /bin/echo "**********  System Hardware Status  **********" >> $LOG
       /bin/echo >> $LOG
       /usr/platform/`uname -i`/sbin/prtdiag -v >> $LOG
       /bin/echo >> $LOG
       /bin/echo >> $LOG
       fi
if [ -f /etc/lvm/md.tab ]; then
       /bin/echo "**********  Disk Suite Disk Status  **********" >> $LOG
       /bin/echo >> $LOG
       /usr/sbin/metastat >> $LOG
       /bin/echo >> $LOG
       /bin/echo >> $LOG
       fi
if [ -f /etc/lvm/md.tab ]; then
       /bin/echo "**********  Disk Suite Meta-db Status  **********" >>
$LOG
       /bin/echo >> $LOG
       /usr/sbin/metadb -i >> $LOG
       /bin/echo >> $LOG
       /bin/echo >> $LOG
       fi

mount -F hsfs $CDDEVICE $MOUNTPOINT
if [ ! -f $MOUNTPOINT/tripwire ] ; then
       mailx -s "$HOST Cannot Mount Tripwire" $MANAGER
       exit
       fi
cd $MOUNTPOINT
/bin/echo "**********  TripWire Report  **********" >> $LOG
/bin/echo >> $LOG
$MOUNTPOINT/tripwire >> $LOG
cd /
umount $MOUNTPOINT

/usr/bin/mailx -s "[Daily Status] $HOST - $NOW" $MANAGER < $LOG
sleep 60
rm $LOG
_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp

This message and attachments are confidential and intended solely for the
individual(s) stated in this
message.If you received this message although you are not the addressee you
are responsible to keep the
message confidential .The sender has no responsibility for the accuracy or
correctness of the
information in the message and its attachments.Our company shall have no
liability for any changes
or late receiving,loss of integrity and confidentiality,viruses and any
damages caused in
anyway to your computer system.

Bu mesaj ve ekleri mesajda gonderildigi belirtilen kisi/kisilere ozeldir ve
gizlidir.Bu mesajin muhatabi
olmamaniza ragmen tarafiniza ulasmis olmasi halinde mesaj iceriginin gizliligi
ve bu gizlilik yukumlulugune
uyulmasi zorunlulugu tarafiniz icin de soz konusudur.Mesaj ve eklerinde yer
alan bilgilerin dogrulugu ve
guncelligi konusunda gonderenin ya da sirketimizin herhangi bir sorumlulugu
bulunmamaktadir.Sirketimiz
mesajin ve bilgilerinin size degisiklige ugrayarak veya gec ulasmasindan,
butunlugunun ve gizliliginin
korunamamasindan, virus icermesinden ve bilgisayar sisteminize verebilecegi
herhangi bir zarardan
sorumlu tutulamaz.



More information about the SunHELP mailing list