RETRIEVE HGU UPTIME USING EXPECT

1.- Install expect

2.- Save this script to a file, make it executable and run it:
 


#!/usr/bin/expect

HGU_IP_ADDRESS=yourhguaddresshere
HGU_PASSWORD=yourpasswordhere

eval spawn ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc [email protected]${HGU_IP_ADDRESS}
set prompt ":|>|\\\$"
interact -o -nobuffer -re $prompt return
send "${HGU_PASSWORD}\r"
interact -o -nobuffer -re $prompt return
send "uptime\r"
interact -o -nobuffer -re $prompt return
send "quit\r"
interact