aggiunto spazio raid allo script di motd

master
Luca Lombardo 3 years ago
parent 498245de8e
commit fe5b141763

@ -74,6 +74,7 @@ HOSTNAME=$(uname -n)
ROOT=$(df -Ph | grep mmcblk0p5 | awk '{print $4}' | tr -d '\n') ROOT=$(df -Ph | grep mmcblk0p5 | awk '{print $4}' | tr -d '\n')
IFS=. read -r s _ < /proc/uptime; d=$((s / 60 / 60 / 24)); h=$((s / 60 / 60 % 24)); m=$((s / 60 % 60)); [ "$d" = 0 ] || UPTIME="${UPTIME}${d}d "; [ "$h" = 0 ] || UPTIME="${UPTIME}${h}h "; [ "$m" = 0 ] || UPTIME="${UPTIME}${m}m "; UPTIME="${UPTIME:-0m}" IFS=. read -r s _ < /proc/uptime; d=$((s / 60 / 60 / 24)); h=$((s / 60 / 60 % 24)); m=$((s / 60 % 60)); [ "$d" = 0 ] || UPTIME="${UPTIME}${d}d "; [ "$h" = 0 ] || UPTIME="${UPTIME}${h}h "; [ "$m" = 0 ] || UPTIME="${UPTIME}${m}m "; UPTIME="${UPTIME:-0m}"
KERNEL=$(uname -r) KERNEL=$(uname -r)
RAID=$(lsblk -b -n -d | awk '$NF!~/sd[a-z]$/ && $NF!~/md[0-9]+$/ && !/loop/ {sum+=$4} END {printf "%.0f", sum/2/1024/1024/1024}')
TEMP_BIG="$(paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C'/ | head -1| cut -d' ' -f3 )" TEMP_BIG="$(paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C'/ | head -1| cut -d' ' -f3 )"
@ -93,12 +94,13 @@ echo "$(tput setaf 1)===================================================
| (_____ | | | (__ | (__ | (__ | (__ | (_____ | | | (__ | (__ | (__ | (__
(_____ ) | | | __) | __) | __) | __) (_____ ) | | | __) | __) | __) | __)
) | | | | ( | ( | ( | ( ) | | | | ( | ( | ( | (
/\____) | | | | (____/\ ) | ) | (____/\ /\____) | | | | (____/\ ) | ) | (____/
\_______) )_( (_______// |/ (_______/ \_______) )_( (_______// |/ (_______/
$(tput setaf 2) $(tput setaf 2)
=================================================== ===================================================
- Hostname............: $HOSTNAME - Hostname............: $HOSTNAME
- Disk Space..........: $ROOT remaining - Disk Space..........: $ROOT remaining
- RAID Space..........: $RAID GB remaining
$(tput setaf 4)=================================================== $(tput setaf 4)===================================================
- CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min) - CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min)
- Memory used.........: $MEMORY1 / $MEMORY2 - Memory used.........: $MEMORY1 / $MEMORY2
@ -110,6 +112,7 @@ $(tput setaf 3)===================================================
- Uptime..............: $UPTIME - Uptime..............: $UPTIME
$(tput sgr0)===================================================" $(tput sgr0)==================================================="
``` ```
## `dnsmasq` e rete interna ## `dnsmasq` e rete interna
`dnsmasq` è un *software libero* che fornisce funzionalità di memorizzazione nella cache DNS (Domain Name System), un server DHCP (Dynamic Host Configuration Protocol), router advertisement e funzionalità di avvio di rete, destinato a reti di computer di piccole dimensioni. Nel nostro caso è utilizzato come server DHCP per assegnare gli indirizzi ai nodi del cluster sulla rete interna (NAT) e offrire un servizio di DNS (nodi raggiungibili tramite il loro nome e non tramite il loro indirizzo IP). `dnsmasq` è un *software libero* che fornisce funzionalità di memorizzazione nella cache DNS (Domain Name System), un server DHCP (Dynamic Host Configuration Protocol), router advertisement e funzionalità di avvio di rete, destinato a reti di computer di piccole dimensioni. Nel nostro caso è utilizzato come server DHCP per assegnare gli indirizzi ai nodi del cluster sulla rete interna (NAT) e offrire un servizio di DNS (nodi raggiungibili tramite il loro nome e non tramite il loro indirizzo IP).

Loading…
Cancel
Save