diff --git a/collect.py b/collect.py index 6f37c98..7b1c33f 100644 --- a/collect.py +++ b/collect.py @@ -358,7 +358,7 @@ def welcome(): print("########################################################################") print("# FreeNAS CORE/SCALE performance capture script v.02 #") print("########################################################################") - print("# This script runs for x minutes and collects cpu/disk/network stats #") + print("# This script collects cpu/mem/disk/network/pool #") print("# When it is completed, it will copy csv files to your /var/log folder #") print("# It will then attempt to take a debug and upload both to our FTP #") print("# If not connected to the internet, it will have to be manually d/l #") @@ -369,10 +369,31 @@ def welcome(): print("") +def is_two_digit_number(number): + return 10 <= number < 100 + + def main(): welcome() minutes = int(input("Enter the duration in minutes: ")) + startHour = 0 + + while not is_two_digit_number(startHour): + startHour = int( + input("Enter start time on 24hr format, 2-digit (ie 2pm = 14): ") + ) + if not is_two_digit_number(startTime): + print("please enter only 2 digits.") + + currentTime = datetime.datetime.now() + currentHour = currentTime.hour + + while not currentHour == startHour: + print(f"Current Time: {currentTime}, script will start at: {startHour}:00") + datetime.datetime.sleep(5) + currentTime = datetime.datetime.now() + currentHour = currentTime.hour print("Starting Collection") diff --git a/readme.org b/readme.org index 0485cd5..623b4af 100644 --- a/readme.org +++ b/readme.org @@ -50,7 +50,7 @@ iostat -xyd 1 1 "f_s", "f_await", "aqu-sz", - "%utilread_s", + "%util", ] ** CPU @@ -82,7 +82,6 @@ top -bn 1 "mem_free", ] - ** Network #+begin_src shell