Motd for ssh ( Just a basic idea on whats going on server side..)
I found this helpful with some of my allstar nodes.. Being able to see how much space is left on the hard drive etc.. along with what the outside temperatures roughly are.. Figured some of you might enjoy this.. Here is the forum post thread where i posted my original help section.. http://forum.kc9zhv.com/index.php/topic,293.0.html Greetings I have decided to run a new MOTD type setup on my servers so I can see whats going on with the server and a really quick basic weather update.. Here is the original article where i had found the info. https://help.ubuntu.com/lts/serverguide/pam_motd.html Ok so here we go.. Code: [Select] sudo apt-get install landscape-common weather-util Now that we have installed the packages here is how to setup your local weather to appear on the MOTD. Code: [Select] sudo nano /usr/local/bin/local-weather So now to setup your weather information server side.. You can find the information here.. http://www.nws.noaa.gov/tg/siteloc.php Code: [Select] #!/bin/sh # # # Prints the local weather information for the MOTD. # # # Replace KINT with your local weather station. # Local stations can be found here: http://www.weather.gov/tg/siteloc.shtml <-- This is old and out of date> echo weather -i KOLY echo Now you need to adjust permissions. Code: [Select] sudo chmod 755 /usr/local/bin/local-weather Now link the files to the correct places.. Code: [Select] sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/98-local-weather If you wish to run a customized script to run the info with out exiting and re-login into the server you can do this.. Now to create this I generally like to make sure i am back to where i usually start out when joining into the server. Code: [Select] cd ~Now we are naming this file sinfo.sh <- you can name this what ever you like.. Code: [Select] nano sinfo.sh Code: [Select] #!/bin/sh run-parts --lsbsysinit /etc/update-motd.d 2>/dev/null Now to run the command you will typ sh sinfo.sh Here is an example of what it could show.. Code: [Select] Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-85-generic x86_64) * Documentation: https://help.ubuntu.com/ Ubuntu 14.04.4 LTS server : ip : 192.99.13.90 hostname : server.lorentedford.com System information as of Fri May 6 18:13:25 CDT 2016 System load: 0.57 Processes: 247 Usage of /home: 12.2% of 1.71TB Users logged in: 1 Memory usage: 33% IP address for eth0: 192.99.13.90 Swap usage: 0% Graph this data and manage this system at: https://landscape.canonical.com/ Searching via station... [caching result Olney-Noble, Olney-Noble Airport, IL, United States] Current conditions at Olney-Noble, Olney-Noble Airport Last updated May 06, 2016 - 06:55 PM EDT / 2016.05.06 2255 UTC Temperature: 71 F (22 C) Relative Humidity: 43% Wind: from the W (280 degrees) at 8 MPH (7 KT) Sky conditions: clear loren@server:~$ [image: Modify message] I hope this is useful to those of you that like to monitor system resources! Loren Tedford (KC9ZHV) Email: lorentedford@gmail.com http://www.lorentedford.com http://www.kc9zhv.com http://forum.kc9zhv.com http://hub.kc9zhv.com http://www.newwavesucks.com http://forum.newwavesucks.com
participants (1)
-
Loren Tedford