sshのMOTDにいくつかのフィールドを追加したいのですが。
今日のMOTD
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
etc/motd を /var/run/motd 以外に指定することで静的なメッセージに変更できることは知っていますが、今日表示される生成データを失いたくはないのです。
デフォルトで生成されるメッセージに、追加の2つのハードディスクからのディスク使用量を追加することは可能でしょうか?例えば
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
編集する必要のあるファイルは /etc/update-motd.d
にあります。
どのように動作するかの詳細は update-motd man page を参照してください。
私のバージョンのUbuntuではディスク使用量が表示されないので、具体的にどのスクリプトを編集する必要があるかはわかりません。
update-motd アプリケーションの設計に関する Ubuntu Wiki の記事](https://wiki.ubuntu.com/UpdateMotd#Design)を見てみてください。このプログラムは update-motd
パッケージに含まれており、よりダイナミックなMOTDを作成するのに役立ちます。