Last active
February 28, 2017 12:29
-
-
Save michel-zimmer/b7f1cd315c5bde6b80a3 to your computer and use it in GitHub Desktop.
How many users are logged in to the Linux PCs from the cs department at University of Bremen?
This file contains 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/sh | |
i=1 | |
while [ $i -le 25 ]; do | |
x=$( printf %02d $i ) | |
printf "x%s: " "${x}" | |
ssh '-o ConnectTimeout=3' "x$x.informatik.uni-bremen.de" "printf \"%s loadavg: %s\\n\" \"\$( who | grep -v '(unknown)' | wc -l)\" \"\$(cat /proc/loadavg)\"" | |
i=$(( i + 1 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment