mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-07-25 01:28:51 +00:00
21 lines
514 B
Bash
21 lines
514 B
Bash
#!/bin/bash
|
|
##################################################
|
|
# #
|
|
# Author: Ankam Ravi Kumar #
|
|
# Website: server-computer.com #
|
|
# Date: 23-02-2019 16:59:56 #
|
|
# Purpose: Capture and Store System Load Average #
|
|
# CPU Usage and Memory Usage #
|
|
##################################################
|
|
# Log File Path
|
|
LOGFILE=/var/log/systemload.log
|
|
|
|
echo "" > /tmp/remotelog
|
|
|
|
for i in `cat /opt/hostnames`;
|
|
do
|
|
cat /root/systemload.sh | ssh $i >> /tmp/remotelog
|
|
done
|
|
|
|
cat /tmp/remotelog |grep -vE "^Last|^There" >> $LOGFILE
|