I've been using /usr/bin/landscape-sysinfo on Ubuntu, and I'm now looking for a good alternative to use on a CentOS machine. Is there anyway to install the requirements to make this work on CentOS?
Asked
Active
Viewed 4,163 times
8
-
I don't have that on my Ubuntu box. What is it? – chiliNUT May 29 '15 at 18:50
-
@chiliNUT you have to install `landscape-common`. On Ubuntu server is placed on `/etc/update-motd.d/50-landscape-sysinfo`. – Pablo A Feb 02 '18 at 02:50
1 Answers
3
I found this script from the article landscape-sysinfo for Centos OS Archived :
#!/bin/bash
#Simple motd script for Centos 5/6
#created by Vitalijus Ryzakovas
b=`tput bold`
n=`tput sgr0`
echo "Checking for system updates:"
while ps aux | grep -e [y]um > /dev/null; do echo -n .;sleep 1; done &
up=`yum -e0 -d0 check-update | awk '{print $1}'`
reset
echo -e "${b}Hostname:${n} `hostname` \t\t IP address: `/sbin/ifconfig venet0:0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'`"
echo -e "${b}CPU load:${n} `cat /proc/loadavg | cut -d" " -f1-3`"
echo -e "${b}Uptime:${n} `uptime | cut -d" " -f 4-7 | cut -d"," -f1-2`"
echo -e "Free memorry: `cat /proc/meminfo | grep MemFree | awk {'print int($2/1000)'}` MB \t\t Total memory: `cat /proc/meminfo | grep MemTotal | awk {'print int($2/1000)'}` MB"
echo -e "${b}Available updates:${n} `if [[ ! -n "${up}" ]]; then echo "system up-to-date"; else echo $up; fi`\n"
echo -e "Mail quere length: `exim -bpc`"
echo -e "Proccess number: `cat /proc/loadavg | cut -d"/" -f2| cut -d" " -f1`\n"
echo -e "${b}Active sessions:${n} `w | tail -n +2`"
Its result will look like this :

-
I start something [here](https://gist.github.com/pabloab/6c1622fb87042b548a11319a78129f30#file-landscape-sysinfo-alternative-sh). @anyone: Feel free to send me your pull requests. – Pablo A Feb 02 '18 at 03:26
-
I recommend using my https://github.com/gdubicki/centos-pam-with-update-motd if you want to port it to Centos 7 and actually want this show up once, on SSH login. – Greg Dubicki Feb 23 '20 at 00:35