diff --git a/collect.sh b/collect.sh index 3b63f14..e863c56 100755 --- a/collect.sh +++ b/collect.sh @@ -6,21 +6,12 @@ greeting="Running perfcollect for $minutes minutes" echo "$greeting" echo "Will auto upload to iXsystem when completed." echo "Airgapped Systems will need to exfiltrate /root/*.csv" +echo "" python3 ./collect.zpool.iostat.py --minutes $minutes & -start_time=$(date +%s) # Get start time in seconds since epoch -duration=$(($1/60)) # Set duration in seconds (here: 5 minutes) - echo "running gstat" -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 - -echo "killing gstat" -pkill gstat +timeout "$minutes"m gstat -C -s -d -o -p -I 60s > /root/gstat.csv & cp /root/zpool_iostat.csv /root/gstat.csv /var/log diff --git a/collect.zpool.iostat.py b/collect.zpool.iostat.py index c11579e..d66bed4 100755 --- a/collect.zpool.iostat.py +++ b/collect.zpool.iostat.py @@ -322,9 +322,7 @@ if __name__ == "__main__": args = parser.parse_args() TIMETORUN = args.minutes - print("Script started.") try: run_zpool_iostat(INTERVAL, COUNT, OUTPUT_FILE, UPDATE_INTERVAL, TIMETORUN) except Exception as e: print(f"An error occurred: {e}") - print("Script ended.")