added startHour

This commit is contained in:
Marc Mance
2024-07-31 18:01:50 -04:00
parent b031179cfd
commit 1a46f34197
2 changed files with 23 additions and 3 deletions

View File

@@ -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")