基于ssh的系统运行时间监视器

一、脚本

#!/bin/bash
#****************************************************
#Date:        2020-06-28
#Author:      Damon Ye
#FileName:   UpTimeMonitor.sh
#Description:The test script
#****************************************************
IP_LIST="10.0.0.233"
USER="root"
red="\033[31m"
shutdown="\033[0m"
for ip in ${IP_LIST}
  do
    echo -e "${red}Uptime${shutdown} of $ip is: `ssh ${USER}@${IP_LIST} 'uptime' | awk '{print $3 $4}'`"                                                                                     
  done

 

猜你喜欢

转载自www.cnblogs.com/ytdyz/p/13202057.html