check system script - July 2012


#!/bin/bash
# purpose: script to check system info;  author: john ; July 2012
if [ ! -d ~/bin/LOGS ]
	then
		/bin/mkdir  ~/bin/LOGS 
		/bin/echo "LOGS directory in ~/bin made"
	fi   
LOG=~/bin/LOGS/Lab_`date +'%Y%m%d'`.txt ; export LOG
echo "" > $LOG    #  clear output file
DATE=`date +'%Y%m%d'` ; export DATE
echo "___________________________________________" | tee -a $LOG
echo "### ( hostname is:  `uname -n` ) ###" | tee -a $LOG
echo "### (this system uses: `ifconfig -a | grep Bcast | awk '{print $2}' | cut -c 6-20`  \
for its IP address with `route | grep default | awk '{print $2}'` as the gateway) ###" | tee -a $LOG
echo "###( these are the nameservers used: `cat /etc/resolv.conf | grep nameserver | awk '{print $2}'` ) ###"  | tee -a $LOG
uptime | awk '{print "system up " $3 " " $4 " at " $1 " load avg=" $12$13 }' | tee -a $LOG
echo "___________________________________________" | tee -a $LOG
echo "### Disk Information ####" | tee -a $LOG
fdisk -l /dev/sda | grep sda  | tee -a $LOG
df -h | grep -v dev | grep -v tmpfs | grep -v rootfs  | tee -a $LOG
du -sh /home/ | tee -a $LOG
du -sh * 2> /dev/null  | tee -a $LOG
 for x in `ls` ; do echo $x;  ls -alR $x 2> /dev/null | wc -l ; done  | tee -a $LOG
for x in `ls` ; do echo $x ; \
# /bin/find $x -user root -perm -4000 -print  2> /dev/null | wc -l ; done  | tee -a $LOG
/bin/find /etc -user root -perm -4000 -print  2> /dev/null | wc -l ; done  | tee -a $LOG
echo "### Usage Information ####" | tee -a $LOG
 last | grep reboot | tail -n 1 | tee -a $LOG
 last | awk '{print $1}' | sort | uniq | grep -v root | grep -v reboot | grep -v wtmp| tee -a $LOG


ebook:
Full Size
Jeep Buyer's
Guide
ebook:
Practical Suggestions
for Microsoft
Windows
Linux Tackles Microsoft
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech-
Bible overview


An overview of Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)