Problem with string split statement

Job ID: 36508256

Budget: ₹600 – ₹1,500 INR

show cpu:
=========
1 percent busy, from 2 sec ago
1 sec avg: 1 percent busy
5 sec avg: 1 percent busy
60 sec avg: 1 percent busy
300 sec avg: 1 percent busy

Idea is to read this 'show cpu' output and write a code in python if the average of 300 sec is above 50 percent then the code should write command outputs to.txt file

I am having a problem with one of my string split statements in Python. This statement is causing no output printed, rather than what I had intended. I am looking for someone to assist in debugging and identifying the issue as soon as possible.

The impacted language is Python, and the type of statement affected is a string split statement. The exact problem occurring is an incorrect output. I need someone who is well versed in these types of issues and can identify and fix them in a timely fashion.

If you think you can help me get to the bottom of this issue, please apply now. Thank you!

My code:
========
from netmiko import ConnectHandler
import time

# create a dictionary with the connection details
devices = {
"device_type": "ruckus_fastiron",
"ip": "10.177.95.107",
"username": "super",
"password": "pass",
}

# create an SSH connection to the device
ssh_conn = ConnectHandler(**devices)

def log_into_device():

# send a command to the device and print the output
cpu_output = ssh_conn.send_command("show cpu")
#print(cpu_output)
time.sleep(1)
output = ssh_conn.send_command("show version")
#print(output)
output = ssh_conn.send_command("show module")
#print(output)

# Check if CPU utilization is over 50%
for line in cpu_output.split("\n"):
if "CPU utilization for the last 300 seconds" in line:
#cpu_utilization = float(line.split()[-1])
cpu_utilization = float(line.split())
if cpu_utilization >= 1:
# Do something if CPU utilization is over 50%
# For example, print a message and save output to a file
print(f"CPU utilization on {ip} is over 50%: {cpu_utilization}%")
with open(f"{ip}-output.txt", "w") as f:
f.write("show cpu utilization-task\n")
f.write(cpu_output)
f.write("\nshow version\n")
f.write(version_output)
f.write("\nshow interfaces\n")
f.write(interfaces_output)
f.write("\nshow module\n")
f.write(module_output)


# Loop through devices and log in every 5 minutes
while True:
for device in devices:
log_into_device()
#time.sleep(300) # Wait 5 minutes before running again