This commit is contained in:
Marc Mance
2024-06-04 13:12:49 -04:00
parent f97aa9d6f0
commit b11682b324

View File

@@ -2,33 +2,41 @@
minutes=$1 minutes=$1
echo "" greeting=$(cat << EOF
echo "THIS SCRIPT IS FOR *FREEBSD* ONLY" .THIS SCRIPT IS FOR FREEBSD.\n\n
echo "" This script will scrape:\n
greeting="Running perfcollect for $minutes minutes" ------------------------\n
echo "$greeting" - Network Interfaces via ifstat\n
echo "Will auto upload to ftp.ixsystem.com when completed." - CPU/Memory via top\n
echo "Airgapped Systems will need to exfiltrate *.csv" - Disk Stats via gstat\n
echo "" - ZFS Pool vai zpool iostat\n\n
Output will be a series of csv files.\n\n
------------------------\n
./collect.sh 60 - will collect for 60 minutes.\n
------------------------\n\n
This script will auto uploaded data to ftp.ixsystems.com when completed.\n
It will also copy the '*.csv' files to /var/log\n
Airgapped systems will need to upload the '*.csv' and/or take a debug.\n
EOF
)
iterations=$1 echo $greeting
echo "Starting gstat Collection" echo "Starting gstat Collection"
timeout "$minutes"m gstat -C -s -d -o -p -I 60s > gstat.csv &
echo "Starting iostat Collection" echo "Starting iostat Collection"
echo "Starting zpool iostat Collection" echo "Starting zpool iostat Collection"
echo "Starting cpu Collection" echo "Starting cpu Collection"
echo "Starting nic Collection" echo "Starting nic Collection"
echo -n "minute:"
for (( i=1; i<=$minutes; i++ )); do
for (( i=1; i<=$iterations; i++ )); do timeout 2s gstat -C -s -d -o -p -I 60s >> gstat.csv &
# Execute the command
python3 zpooliostat.py python3 zpooliostat.py
python3 iostat.py python3 iostat.py
python3 topstat.py python3 topstat.py
python3 ifstat.py python3 ifstat.py
echo "minute: $i" echo -n " $i"
# Wait for 60 seconds before the next iteration # Wait for 60 seconds before the next iteration
sleep 60 sleep 60
done done