Files
Wirawan Purwanto e828a16a49 * Expanded support to Wahab.
Last updated 2021-03-02.
2021-06-29 13:25:15 -04:00

34 lines
588 B
Bash
Executable File

#!/bin/bash
DATETIME=$(date +"%Y%m%d-%H%M%S")
CLUSTER=$(cat /etc/cluster)
case "$CLUSTER" in
turing)
LOGDIR=$HOME/admin/login-patrol/turing
;;
wahab)
LOGDIR=$HOME/admin/login-patrol/wahab
;;
*)
echo "Error: unsupported cluster: $CLUSTER" >&2
exit 2
;;
esac
whats_going_on () {
date
echo
top -b -n 1 | head -n 60 | tee $LOGDIR/top-${DATETIME}
echo
ps fuxa > $LOGDIR/ps-fuxa-${DATETIME}
cat $LOGDIR/ps-fuxa-${DATETIME}
}
if test -t 1; then
whats_going_on | less
else
whats_going_on
fi