From 48292c6730a54697e4fe7faef82ed642d7146a93 Mon Sep 17 00:00:00 2001 From: Marc Mance Date: Tue, 4 Jun 2024 13:17:20 -0400 Subject: [PATCH] added gitignore --- .gitignore | 3 ++- collect.sh | 18 ++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 16f2dc5..acc54b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.csv \ No newline at end of file +*.csv +test.sh \ No newline at end of file diff --git a/collect.sh b/collect.sh index 4ae1a70..78a783a 100755 --- a/collect.sh +++ b/collect.sh @@ -1,8 +1,6 @@ #!/bin/bash - minutes=$1 - echo "THIS SCRIPT IS FOR FREEBSD." echo "" echo "This script will scrape:" @@ -12,7 +10,6 @@ echo "- CPU/Memory via top" echo "- Disk Stats via gstat" echo "- ZFS Pool vai zpool iostat" echo "" -echo "Output will be a series of csv files." echo "------------------------" echo "./collect.sh 60 - will collect for 60 minutes." echo "------------------------" @@ -20,14 +17,16 @@ echo "" echo "This script will auto uploaded data to ftp.ixsystems.com when completed." echo "It will also copy the '*.csv' files to /var/log" echo "Airgapped systems will need to upload the '*.csv' and/or take a debug." - - +echo "" +echo "" echo "Starting gstat Collection" echo "Starting iostat Collection" echo "Starting zpool iostat Collection" echo "Starting cpu Collection" echo "Starting nic Collection" +echo "" echo -n "minute:" + for (( i=1; i<=$minutes; i++ )); do timeout 2s gstat -C -s -d -o -p -I 60s >> gstat.csv & @@ -36,12 +35,11 @@ for (( i=1; i<=$minutes; i++ )); do python3 topstat.py python3 ifstat.py -echo -n " $i" - # Wait for 60 seconds before the next iteration - sleep 60 + echo -n " $i" + sleep 60 + done cp *.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 +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