23 lines
777 B
Bash
Executable File
23 lines
777 B
Bash
Executable File
#!/bin/bash
|
|
|
|
greeting="Running perfcollect for $1 minutes"
|
|
echo "$greeting"
|
|
echo "Will auto upload to iXsystem when completed."
|
|
echo "Airgapped Systems will need to exfiltrate /root/*.csv"
|
|
|
|
python3 ./collect.zpool.iostat.py --minutes $1
|
|
|
|
start_time=$(date +%s) # Get start time in seconds since epoch
|
|
duration=$(($1*60)) # Set duration in seconds (here: 5 minutes)
|
|
|
|
gstat -C -s -d -o -p -I 60s > /root/gstat.csv & # Run the command in the background
|
|
|
|
while [[ $(($(date +%s) - $start_time)) -lt $duration ]]; do
|
|
sleep 1
|
|
done
|
|
|
|
cp /root/zpool_iostat.csv /root/gstat.csv /var/log
|
|
|
|
DEBUGFILE=`midclt call system.debug_generate -job` && export DEBUGFILE
|
|
curl --user customer:ixcustomer -T $DEBUGFILE ftp.ixsystems.com/debug-`hostname`-`date +%Y%m%d%H%M`.tgz
|