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.htmlOk so here we go..
sudo apt-get install landscape-common weather-utilNow that we have installed the packages here is how to setup your local weather to appear on the MOTD.
sudo nano /usr/local/bin/local-weatherSo now to setup your weather information server side..
You can find the information here..
http://www.nws.noaa.gov/tg/siteloc.php#!/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.
sudo chmod 755 /usr/local/bin/local-weatherNow link the files to the correct places..
sudo ln -s /usr/local/bin/local-weather /etc/update-motd.d/98-local-weatherIf 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.
cd ~Now we are naming this file sinfo.sh <- you can name this what ever you like..
nano sinfo.sh#!/bin/sh
run-parts --lsbsysinit /etc/update-motd.d 2>/dev/nullNow to run the command you will typ sh sinfo.sh
Here is an example of what it could show..
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:~$