#!/bin/bash
#       serverstatus, a script to monitor critical server stats
#       original written by jimakens
#       20120315  lstolp updated for use with r2r netbooks
#
#

cruise=CRUISEID
statfile="$cruise"_serverstats
statfile="/shipdata/$cruise/r2r/eventlog/logfiles/mv1108_serverstats"

date            > $statfile
echo >> $statfile
echo "Checking local time server: * indicates lock." >> $statfile
/usr/bin/ntpdc -c dmp             >> $statfile
echo >> $statfile
echo "Checking disk usage disk usage" >> $statfile
echo >> $statfile
/bin/df         >> $statfile
echo >> $statfile

echo -n "Checking the " >> $statfile
/sbin/route -n  >> $statfile
echo >> $statfile

echo -n "Checking Top memory hogs:" >> $statfile
echo >> $statfile
/bin/ps auxf | sort -nr -k 4 | head -5 >> $statfile
echo >> $statfile

echo -n "memory:" >> $statfile
echo >> $statfile
/usr/bin/vmstat >> $statfile
echo >> $statfile


echo >> $statfile

