#!/bin/ksh # # ckstats 11.4.1996 AIX 4.2 # # creates a file that captures critical system info. # # Writes output to a file called "hostname"."day of the week".status # and then prints the file. The file will be created # daily and overwritten once a week. # # e.g. beryl.Monday.status, amethyst.Monday.status # # written by john meister pager:290-2777 Nov 4, 1996 # # (note: with the "quot" command this must be run as root user) # # This file should be set up to run under the control of cron. # # Because this file will be executed as root, ALL commands must # be fully resolved. # # REVISIONS TO BE NOTED HERE: # ------------------------------------------------------------- # # ------------------------------------------------------------- # execute process status (custom format) # ------------------------------------------------------------- # /usr/bin/echo "============================" | /usr/bin/tee `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo " /usr/bin/ps run on: `/usr/bin/date`" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo "==========================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # # execute process status (custom format) # /usr/bin/echo "COMMAND: /usr/bin/ps -efklo %p__ %c %P %C %zK %U %x%y" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo "==========================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # # /usr/bin/echo " `whoami` on `/usr/bin/hostname` printed this out." | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # # /usr/bin/echo "=========================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # # /usr/bin/echo " " # # # examine file system # # /usr/bin/echo "/usr/bin/df on `/usr/bin/hostname`:" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # # /usr/bin/echo "=========================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/df | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo "==========================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo " " # # /usr/sbin/quot command - MUST BE RUN AS ROOT USER>>>>>>>>>>>>>>>>>> # /usr/bin/echo "/usr/sbin/quot on `/usr/bin/hostname`:" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo "=======================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/sbin/quot | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo " " # /usr/bin/echo "======================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo " " # # capture process status # /usr/bin/echo "/usr/bin/ps on `/usr/bin/hostname`:" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/echo "======================" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # /usr/bin/ps -efklo "%p__ %c %P %C %zK %U %x%y" | /usr/bin/tee -a `/usr/bin/hostname`.`/usr/bin/date +%a`.status # #/usr/bin/lp `/usr/bin/hostname`.`/usr/bin/date +%a`.status #