If you have run Ubuntu Server you may have noticed that each time you log into your system via SSH system information status are displayed.
I have wondered this for a while now and tonight I found out.
The command to reproduce this information is
landscape-sysinfo
This command is run from /etc/update-motd.d/50-landscape-sysinfo and exists when the landscape common package is installed on the server from what I have read.
And now I know.
A look inside the script:
#!/bin/sh
cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
[ “$cores” -eq “0” ] && cores=1
threshold=”${cores:-1}.0″
if [ $(echo “`cut -f1 -d ‘ ‘ /proc/loadavg` < $threshold” | bc) -eq 1 ]; then
echo
echo -n ” System information as of “
/bin/date
echo
/usr/bin/landscape-sysinfo
else
echo
echo ” System information disabled due to load higher than $threshold”
fi
#eof