show fortigate uptime 1

show fortigate uptime

# get system performance status | grep Uptime

Here is what the above code is Doing:
1. We’re using the subprocess module to run the command “uptime” on the command line.
2. We’re using the check_output() function to run the command and store the output in a variable.
3. We’re using the split() function to split the output into a list.
4. We’re using the strip() function to remove the leading and trailing whitespace from the list items.
5. We’re using the join() function to join the list items back together into a string.
6. We’re using the print() function to print the string.

Similar Posts