Created
January 31, 2018 13:48
-
-
Save vaughany/e4c724571bcbddf71c62253d4e264266 to your computer and use it in GitHub Desktop.
Pulls memory stats from servers at IP addresses of your choice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| IPS="10.10.10.10 10.10.10.11 10.10.10.12" | |
| for s in $IPS; do | |
| echo -en "\n\e[7;49m $s - " && echo -n $(ssh -q -F /dev/null $s "hostname") && echo -e ": \e[0m" | |
| RESULT=$(ssh -q -F /dev/null $s "lsb_release -r") | |
| if [[ $RESULT = *"14.04"* ]] | |
| then | |
| ssh -q -F /dev/null $s "free -h" | |
| else | |
| ssh -q -F /dev/null $s "free -w -h" | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment