This commit is contained in:
Marc Mance
2024-05-30 12:23:51 -04:00
parent fe31600717
commit 7bc07a2b41

View File

@@ -2,6 +2,7 @@ import subprocess
import re import re
import csv import csv
import os import os
import time
# Define your shell command # Define your shell command
command = ["zpool", "iostat", "-Tu", "-l", "-p", "-v", "-y", "1", "1"] command = ["zpool", "iostat", "-Tu", "-l", "-p", "-v", "-y", "1", "1"]
@@ -46,6 +47,11 @@ def runZpoolIostat():
if i == 0: if i == 0:
# get timestamp # get timestamp
timestamp = pool.splitlines()[0].strip() timestamp = pool.splitlines()[0].strip()
# Convert to human-readable time using time.localtime()
local_time = time.localtime(timestamp)
# Format the time components for a more readable output
timestamp = time.strftime("%Y-%m-%d %H:%M:%S", local_time)
breakpoint() breakpoint()
else: else: