pass days

main
vitrinekast 8 months ago
parent 1b8bd28790
commit 7f9f3a397c

@ -55,7 +55,7 @@ print("start running the log commands");
if not time_ago_arg: if not time_ago_arg:
since_last_boot = run_command(["uptime","-s"]) since_last_boot = run_command(["uptime","-s"])
slb_date = datetime.strptime(since_last_boot, "%Y-%m-%d %H:%M:%S") slb_date = datetime.strptime(since_last_boot, "%Y-%m-%d %H:%M:%S")
time_since_last_boot = now - slb_date time_since_last_boot = (now - slb_date).days
device_info_grab = subprocess.run(["grep", 'Model' , "/proc/cpuinfo"], check=True, capture_output=True) device_info_grab = subprocess.run(["grep", 'Model' , "/proc/cpuinfo"], check=True, capture_output=True)
device_info = run_command(['awk', '-F:', '{ print $2}'], based=device_info_grab.stdout) device_info = run_command(['awk', '-F:', '{ print $2}'], based=device_info_grab.stdout)
ip_address_show = subprocess.run(["ip", "addr", "show", "end0"], check=True, capture_output=True) ip_address_show = subprocess.run(["ip", "addr", "show", "end0"], check=True, capture_output=True)
@ -107,7 +107,7 @@ output = template.render(
list_package_upgrade=list_package_upgrade, list_package_upgrade=list_package_upgrade,
list_package_remove=list_package_remove, list_package_remove=list_package_remove,
device_info=device_info, device_info=device_info,
days_since_last_boot = time_since_last_boot.days, days_since_last_boot = time_since_last_boot,
kitchen_services = kitchen_services, kitchen_services = kitchen_services,
ip_address = ip_address, ip_address = ip_address,
logins_today = run_command(['grep', '-v', "Boot"], based=logins_today_log.stdout).splitlines(), logins_today = run_command(['grep', '-v', "Boot"], based=logins_today_log.stdout).splitlines(),

Loading…
Cancel
Save