feat: add scripts to get stats from master node

main
Francesco Minnocci 11 months ago
parent 425cf4d371
commit 1bf04d9872
No known key found for this signature in database
GPG Key ID: 76DA3AF9BAED1A32

@ -0,0 +1,6 @@
#!/bin/bash
# Returns CPU percentages of all machines in the cluster
# Example output: steffe3 3.5
parallel --nonall --slf /home/rock/macchine.txt top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | sed "s/^/100 - /" | bc

@ -0,0 +1,6 @@
#!/bin/bash
# Returns used and total memory (in MB) of all machines in the cluster
# Example output: steffe1 141 3814
parallel --nonall --slf /home/rock/macchine.txt 'echo $HOSTNAME $(free -m | awk '\''/Mem/{print $3" "$2}'\'')'

@ -0,0 +1,6 @@
#!/bin/bash
# Returns received and transmitted bytes of all machines in the cluster
# Example output: steffe14 3581663131 3305835017
parallel --nonall --slf /home/rock/macchine.txt 'echo $HOSTNAME $(cat /sys/class/net/[e]*/statistics/{r,t}x_bytes)'

@ -0,0 +1,6 @@
#!/bin/bash
# Returns used and free disk space of all machines in the cluster
# Example output: steffe8 9.2G 47G
parallel --nonall --slf /home/rock/macchine.txt 'echo $HOSTNAME $(df -Ph | grep mmcblk0p5 | awk '\''{print $3" "$4}'\'')'

@ -0,0 +1,6 @@
#!/bin/bash
# Returns Unix uptime, in seconds, of all machines in the cluster
# Example output: steffe1 1656959
parallel --nonall --slf /home/rock/macchine.txt 'echo $HOSTNAME $(cut -f1 -d. /proc/uptime)'
Loading…
Cancel
Save