Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to add some fields to the ssh MOTD.

MOTD today:

Linux toker 2.6.31-22-generic-pae #69-Ubuntu SMP Wed Nov 24 09:04:58 UTC 2010 i686

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

  System information as of Tue Jan 25 19:25:53 CET 2011

  System load:  0.23                Processes:           139
  Usage of /:   76.8% of 911.20GB   Users logged in:     1
  Memory usage: 17%                 IP address for eth0: 192.168.1.102
  Swap usage:   0%

  Graph this data and manage this system at https://landscape.canonical.com/

38 packages can be updated.
38 updates are security updates.

No mail.
Last login: Tue Jan 25 19:22:06 2011 from 192.168.1.106

I know that I could change this to a static message by pointing /etc/motd to something else than /var/run/motd but I do not want to loose the generated data that is presented today.

Is it possible to add the disk usage off two additional hard drives to the message that is generated by default? For example:

Linux toker 2.6.31-22-generic-pae #69-Ubuntu SMP Wed Nov 24 09:04:58 UTC 2010 i686

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

  System information as of Tue Jan 25 19:25:53 CET 2011

  System load:  0.23               Processes:           139
  Memory usage: 17%                Users logged in:     1
  Swap usage:   0%                 IP address for eth0: 192.168.1.102

  Usage of /:            76.8% of 911.20GB
  Usage of /media/hddb/:    8% of 1.8T
  Usage of /media/hddc/:   16% of 1.8T

  Graph this data and manage this system at https://landscape.canonical.com/

38 packages can be updated.
38 updates are security updates.

No mail.
Last login: Tue Jan 25 19:22:06 2011 from 192.168.1.105
share|improve this question
add comment

3 Answers

up vote 11 down vote accepted

Take a look at the Ubuntu Wiki article about the design of the update-motd application. This program is contained in the update-motd package and will help you to create a more dynamic MOTD.

share|improve this answer
add comment

The files you need to edit live in /etc/update-motd.d.

See the update-motd man page for details about how it works.

My version of Ubuntu doesn't show the disk usage, so I'm not sure which script exactly you need to edit.

share|improve this answer
    
That looks like the Ubuntu-Server motd. –  Broam Apr 18 '11 at 19:01
add comment

You can't edit the Script without extra coding. The message you see is shown with a wrapper script which calls /usr/bin/landscape-sysinfo. The output you see is created by landscape-sysinfo

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.