Reputation: 1
I have to create a Shell script which would get the latest linux server load status from different-2 clusters for every 2 second into my shell.
What parameters I have to take care while creating this?
a.) server name b.) server password c.) watch command i.e watch -n 2 w
I need to create two tabs like server name and server load against that
I will ssh for connecting servers and also I would appreciate if someone suggest better way to achieve this?
Thanks in advance
Upvotes: 0
Views: 763
Reputation: 208052
while : ; do
ssh host1 uptime
ssh host2 uptime
sleep 120
tput clear
done
Upvotes: 1
Reputation: 8571
Instead of reinventing the wheel why dont you use that.
There are many tools which are doing the same task you need. Below tools will provide you sys stat after specified time and will store that data also for later use
Writing shell script for such task has many disadvantages like,
I hope you understand the point I am trying to put here.
Upvotes: 3