Monday, January 23, 2023

Script for Pulling Uptime Information from Remote VMs

Script for Pulling Uptime Information from Remote VMs


This script prompts the user for an input file containing a list of VMs, checks if the input file exists, creates an output file to store the hostname and uptime information, and loops through the list of VMs to remotely connect to each one and pull the uptime information. The hostname and uptime are then extracted from the uptime_info and appended to the output file.

It uses the "uptime" command to get the uptime information and "awk" command to extract the uptime information, which is in the third field and

No comments:

Post a Comment