Script to gather System Infomation

This script could be used as an alternative to the one one to gather sar graphs. 




2) Add an entry in root's cron as follows;-


30 0 * * * /usr/local/bin/sys-health
3) Create the sys-health script and put on each system;-
Click for the sys-health script

4) On the "$TARGET" system create the sys-info script. HTM_DIR is the document root (and location) of the web server.


#!/bin/sh 
#exec 1>/tmp/errs 2>/tmp/errs
#set -x
# Responder from sys-health see /etc/mail/aliases
#

HTM_DIR=/var/apache/htdocs/sysinfo

while read subject host ; do
        [ "$subject" = "Subject:" ] && break
done

[ ! -d /${HTM_DIR}/$host ] && mkdir -p /${HTM_DIR}/$host
cat > /${HTM_DIR}/$host/index.html
5) Edit the /etc/mail/aliases and add the following line to the end. Then run /usr/sbin/newaliases.
trial:          "|/usr/local/bin/sys-info"

© R. Davies. 2007, Wolf Consulting Ltd.