Jump to content


Photo

new motd for ubuntu/debian


  • Please log in to reply
18 replies to this topic

#1 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 11 January 2016 - 10:23 PM

Ok so first a big thanks to Igor for the work he has put into armbian, started using this build when it was still posted on Igor's site

 

anyway i wanted more information out of the motd and here is what i came up with this is running on my cubietruck with the latest kernel 

     _
 ___| |_ ___  _ __ __ _  __ _  ___
/ __| __/ _ \| '__/ _` |/ _` |/ _ \
\__ \ || (_) | | | (_| | (_| |  __/
|___/\__\___/|_|  \__,_|\__, |\___|
                        |___/

Welcome to Ubuntu 14.04.3 LTS (4.3.3-sunxi).

System information as of: Mon Jan 11 21:34:35 EET 2016

System load:       0.14         Memory usage: 97.5%
Local users:       0            Swap usage:   0.0%
IP address:        888.888.88.8 Uptime:       up 6 days, 19 hours, 50 minutes
Usage of root/:    8% of 16G    HDD temp:     43°C
Usage of storage/: 26% of 443G  Board temp:   47°C

0 updates to install.
0 are security updates.

Last login: Mon Jan 11 07:50:37 2016 from 888.888.88.888
root@storage:~#

this should work with both debian and ubuntu versions but has some hard coded values at least for the sensor temp in the cubietruck 

 

upload everything from the archive to the /etc/ folder, make the files inside executable (chmod +x) - the files are taken from https://nickcharlton...namic-motd.htmlbut 10-sysinfo was updated with more information

 

finally disable default motd by editing the bash.bashrc files (remove/delete) this lines

if [ -f /etc/bash.bashrc.custom ]; then
    . /etc/bash.bashrc.custom
fi 

 after this with every new login you should see the new motd

 

Attached Files


  • Igor, Tido and wildcat_paris like this

#2 wildcat_paris

wildcat_paris

    Advanced Member

  • Senior Members
  • PipPipPip
  • 499 posts

Posted 12 January 2016 - 02:32 AM

yes thanks!

 

from nickcharlton

sudo chmod +x /etc/update-motd.d/

seems enough to work with my config

 

Spoiler

  • Wolf2000 likes this

#3 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 12 January 2016 - 08:17 AM

There was something that bugged me since day one, the memory usage calculation is off, because it doesn't take into account the memory used for buffers anyway I will update the archive today to reflect the changes :)

#4 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 12 January 2016 - 09:36 PM

ok so regarding the memory usage the output of free its a bit misleading (i was before i googled it) if your not familiar with how linux treats ram memory - http://www.linuxatemyram.com/will explain better than i could  

 

ok so here is the updated 10-sysinfo :)

     _
 ___| |_ ___  _ __ __ _  __ _  ___
/ __| __/ _ \| '__/ _` |/ _` |/ _ \
\__ \ || (_) | | | (_| | (_| |  __/
|___/\__\___/|_|  \__,_|\__, |\___|
                        |___/

Welcome to Ubuntu 14.04.3 LTS (4.3.3-sunxi).

System information as of: Tue Jan 12 22:31:17 EET 2016

System load:       0.37                 Memory usage: 7.0%
Local users:       1                    Swap usage:   0.0%
IP address:        192.168.88.4         Uptime:       up 1 week, 20 hours, 46 minutes
Usage of root/:    7% of 16G            HDD temp:     43°C
Usage of storage/: 26% of 443G          Board temp:   49°C

0 updates to install.
0 are security updates.

Last login: Tue Jan 12 22:30:41 2016 from 192.168.88.100
root@storage:~#

Attached Files


  • wildcat_paris likes this

#5 wildcat_paris

wildcat_paris

    Advanced Member

  • Senior Members
  • PipPipPip
  • 499 posts

Posted 13 January 2016 - 12:38 AM

cool! next task... adding some colors ;) thanks!

System load:       0.03                 Memory usage: 55.8%
Local users:       1                    Swap usage:   9.8%
IP address:        86.218.14.121        Uptime:       up 5 days, 11 hours, 27 minutes
Usage of root/:    35% of 15G           HDD temp:     43°C
Usage of storage/: 14% of 116G          Board temp:   37°C



#6 tkaiser

tkaiser

    Advanced Member

  • Moderators
  • 2660 posts

Posted 13 January 2016 - 09:56 AM

Good work! :)

 

But there's a problem with these sort of 'snap-shot' data collections: while they're easy to collect/implement/display their meaning is pretty irrelevant.

 

As an example: Temperatures -- why should it be interesting to get the actual values? You're more interested in temperature peaks that occured, right? So you would have to collect them permanently and display the highest value since the last time you logged in (can be done but requires some efforts and either reinventing the wheel or the useage of already available monitoring tools)

 

This applies also to average load (that is somewhat problematic anyway -- see below), local users and storage/swap/memory useage. The peak value since last login is interesting and not the current one if you care about identifying problems (like a cronjob that starts at midnight and amoks for hours every night which you will never now by looking at login values).

 

BTW: Very useful to interpret some of the commonly used 'metrics' and their real meanings: http://slideshare.ne...rformance-tools


Please don't send personal messages! Use the forum so others can participate and benefit!

 

Before you report any problem please be aware that crappy SD cards and insufficient power supply are reason N° 1 why things are failing. Try to rule this out first please, check 'getting started' recommendations and check/provide 'sudo armbianmonitor -u' output first!

 

Did you check out custom google powered forum search already (before opening new threads or asking questions)?


#7 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 14 January 2016 - 09:31 AM

information is irrelevant only if you consider it irrelevant, and lets not forget this is only a motd.

 

If you have a problem with the temperature it could be cause by a hardware problem in which case no piece of software is going to help you. Actually you can write a piece of code in *insert random programming language here* to regularly check the temperature and if it passed certain threshold shutdown the hardware to prevent damage but at least for A20 chips the datasheet states a recommended ambient temperature of max Ta = 70C, no information given for junction temperature (the temperature inside the IC) but it will work perfectly well above 100C. 

 

If on the other hand the rise in temperature its cause by software, without data logging every event you can't tell why you had a rise in temperature and that is in my opinion irrelevant.

 

regarding your cronjob example, you dont test your code before you start using it on a cronjob ?you controll the hw with the sw you write, why would the code hang if it was written to be robust ?I am sorry but using resource monitor to debug poorly written code you are doing it wrong.

 

returning to motd this is not suppose to replace a real system monitor, it supposed to give you quick information when you login, and for me this is all i want, and if you know you are expecting high loads/usage/temperatures you should look at the hundreds of linux monitors which will work on any board that could run armbian  

 

 

 



#8 tkaiser

tkaiser

    Advanced Member

  • Moderators
  • 2660 posts

Posted 14 January 2016 - 10:10 AM

If you have a problem with the temperature

 

Me? Nope, I have neither a problem with real temperatures nor wrong temperature read-outs (the usual 'we trust in numbers blindly' approach). I thought about the people you share your work with. And I'm sorry if you took my remarks as an insult. I just wanted to give a few suggestions.

 

A final one: The sysinfo stuff you promote here only works correctly under certain circumstances therefore most users won't be able to benefit from. Why not doing it right and differentiate between different boards and kernel variants? All the work is already done and just waits to be adopted:

 

https://github.com/i...ripts/armhwinfo

 

https://github.com/i.../scripts/bashrc


Please don't send personal messages! Use the forum so others can participate and benefit!

 

Before you report any problem please be aware that crappy SD cards and insufficient power supply are reason N° 1 why things are failing. Try to rule this out first please, check 'getting started' recommendations and check/provide 'sudo armbianmonitor -u' output first!

 

Did you check out custom google powered forum search already (before opening new threads or asking questions)?


#9 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 14 January 2016 - 10:54 AM

why would i take it as an insult :P

 

i clearly stated in the first post that some values are hard coded and i am using the mainline kernel which makes this not usable for everyone.

 

Surely it could be updated to work with all the boards and different kernels but i only have a cubietruck with the mainline kernel so i can't really test the changes on other boards and since my cubietruck is working as a 24/7 server i dont really want to take it down and check other kernels - but if you or any one else has hardware/time to test and make changes you are more than welcomed to do so, this is why i also posted this here :)



#10 tkaiser

tkaiser

    Advanced Member

  • Moderators
  • 2660 posts

Posted 14 January 2016 - 11:28 AM

but if you or any one else has hardware/time to test and make changes you are more than welcomed to do so

 

Definitely not :)

 

There is already code that deals will all boards that Armbian supports so I will never ever start to fix code that totally ignores that (to display even less relevant informations compared to the default one -- missing battery information for example). The way to go is to improve this already existing code instead of reinventing the wheel and introduce new and incompatible code.

 

Currently I'm thinking about extracting the thermal stuff from Armbian's default bashrc (since it's useful for users that use zsh for example or even other more advanced shells), combine it with monitoring to be able to display more interesting read-outs (peak values for the last 24h for example) to be able to also enhance motd: http://forum.armbian...itor-in-armbian


Please don't send personal messages! Use the forum so others can participate and benefit!

 

Before you report any problem please be aware that crappy SD cards and insufficient power supply are reason N° 1 why things are failing. Try to rule this out first please, check 'getting started' recommendations and check/provide 'sudo armbianmonitor -u' output first!

 

Did you check out custom google powered forum search already (before opening new threads or asking questions)?


#11 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 14 January 2016 - 12:15 PM

ok let me put things in a different perspective for you

 

1. I don't really care about other boards, i clearly stated in the first post on what board/kernel this was written for.

2. the battery information is not relevant for me since i don't use a battery.

3. I am not reinventing the wheel I just chose a different way to fix my problem and i certainly did not introduce incompatible code because the code runs on the board/kernel it was written for (i am not quite sure why you refuse to understand that) also i think every one here is old enough to decide for himself/herself if he/she wants to use what i posted or not.

 

I only posted this because i thought it could be helpful for someone else, clearly for your case its not but i don't get why you keep telling me that i am trying to reinvent the wheel as long as this, as it is currently fixes my problem.

 

hope this makes things more easier to understand also i see no reason to keep discussing why i did it like this so you either use it like this propose new changes or go play somewhere else.



#12 tkaiser

tkaiser

    Advanced Member

  • Moderators
  • 2660 posts

Posted 14 January 2016 - 01:32 PM

Welcome to Ubuntu 14.04.3 LTS (4.4.0-rc8-sunxi).
...
Usage of storage/:  of          Board temp:   37°C
...
Load: 0.20, 0.10, 0.06 - Board: 39.1°C - Memory: 508Mb

 

Guillaume, may I ask which board you're running this on? Lamobo R1?

 

Do you still get those nice discrepancies between the motd and Igor's bashrc stuff (especially 'Memory')? And aren't you concerned that your board is swapping constantly even if it has plenty amounts of free memory? Care to post the output of this motd stuff immediately followed by the output of 'swapon -s'?

 

Thx


Please don't send personal messages! Use the forum so others can participate and benefit!

 

Before you report any problem please be aware that crappy SD cards and insufficient power supply are reason N° 1 why things are failing. Try to rule this out first please, check 'getting started' recommendations and check/provide 'sudo armbianmonitor -u' output first!

 

Did you check out custom google powered forum search already (before opening new threads or asking questions)?


#13 Igor

Igor

    Administrator

  • Administrators
  • 2888 posts

Posted 14 January 2016 - 06:07 PM

newmotd.jpg

 

https://github.com/i...s/update-motd.d

 

I also did some rework based on those ideas. Battery info is also included, but need further testing. One full charge / discharge cycle is needed for auto calibration.

 

- info that is not needed is hidden: if no updates available, if there is only one user logged, if there is no temperature readings, ....

- each info has it's own configurable red point

 

Not included anywhere ... yet. Only testing.


  • tkaiser, Tido and wildcat_paris like this

Want to send me a private message? Stop and think again. If there’s no reason for it to be private, it should be public. Thank you!


#14 tkaiser

tkaiser

    Advanced Member

  • Moderators
  • 2660 posts

Posted 14 January 2016 - 06:19 PM

Thx, Igor!

 

Temperature read-outs will currently fail with sunxi 3.4.x kernel, right? And you're relying directly on i2c -- good.

 

BTW: Anyone able to compare 4.3 vs. 4.4 regarding A20 thermal read-outs? It seems 4.3 provides higher values. Can't remember exactly but with 4.0 or 4.1 we had the problem that thermal values were way too low (even below ambient temperature).


Please don't send personal messages! Use the forum so others can participate and benefit!

 

Before you report any problem please be aware that crappy SD cards and insufficient power supply are reason N° 1 why things are failing. Try to rule this out first please, check 'getting started' recommendations and check/provide 'sudo armbianmonitor -u' output first!

 

Did you check out custom google powered forum search already (before opening new threads or asking questions)?


#15 wildcat_paris

wildcat_paris

    Advanced Member

  • Senior Members
  • PipPipPip
  • 499 posts

Posted 14 January 2016 - 08:05 PM

Guillaume, may I ask which board you're running this on? Lamobo R1?

 

Do you still get those nice discrepancies between the motd and Igor's bashrc stuff (especially 'Memory')? And aren't you concerned that your board is swapping constantly even if it has plenty amounts of free memory? Care to post the output of this motd stuff immediately followed by the output of 'swapon -s'?

 

 

Herr Thomas,

 

As you guessed, yes!

 

in fact, I have set the board to do swap by tweaking the kernel to do it, also I am using zram then the ssd if needed

 

Spoiler

 

 

Also I have plenty of temperature I cannot compare including the picoolfan temp

Spoiler
et voilà



#16 Toast

Toast

    Advanced Member

  • Senior Members
  • PipPipPip
  • 61 posts

Posted 14 January 2016 - 10:32 PM

My little motd :P

░█▀▀░▄▀▄░█░█░█▀▀░█▀▀░▀▀█░█▀▀░█▀▄░█▀█░█░█
░▀▀█░█\█░█░█░█▀▀░█▀▀░▄▀░░█▀▀░█▀▄░█░█░▄▀▄
░▀▀▀░░▀\░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀▀░░▀▀▀░▀░▀

Welcome to Debian GNU/Linux 8.2 (jessie) (Kernel Version: 4.3.3-sunxi).

System Information

System load: 0.49 Memory usage: 97.2%
Usage on root: 66% Usage on hdd: 62%
S.M.A.R.T: OK Swap usage: 0.0%
Processes: 108 IP: 10.0.0.53
CPU: 34.1°C HDD: 31°C

System Updates

1 updates to install.
0 are security updates.
0 npm updates to install.
0 pip updates to install.

System Services

squeezeboxserver: # syncthing: # mysql: #

System Logs

[Mon Jan 11 11:15:13 2016] sun7i-dwmac 1c50000.ethernet eth0: Link is Down
[Mon Jan 11 11:15:36 2016] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx

System Uptime

Current 15 days, 10:29:54 | Linux 4.3.3-sunxi Wed Dec 30 12:01:13 2015
Total 24 days, 01:21:30 | since Sun Dec 20 00:41:11 2015

the squeezebox and syncthing are color coded so that the hashtag displays red if its down and green if its up


  • Wolf2000 and wildcat_paris like this

#17 Toast

Toast

    Advanced Member

  • Senior Members
  • PipPipPip
  • 61 posts

Posted 03 March 2016 - 09:30 AM

So i got tired of having it spread out and made one file for it all :) feel free to improve upon it :D it adds itself to profile and if its missing tools it displays N/A

 

uses these packages: cpufrequtils, smartmontools, uptimed, toilet

chmod +x /usr/bin/motd

Screenshot_2016-03-03_09-27-59.png

 

Attached File  motd.zip   1.55KB   200 downloads



#18 help40

help40

    Member

  • Senior Members
  • PipPip
  • 25 posts

Posted 20 March 2016 - 10:20 AM

motd looks fantastic, but I wonder how I can get rid of it ? as I do not need it?


  • candratech likes this

"Even if a man lives well, he dies and another one comes into existence. Let the one who comes later upon seeing this inscription remember the one who had made it. And the name is Omurtag, Kanas u bigi. Let God make him live 100 years"


#19 vlad

vlad

    Member

  • Senior Members
  • PipPip
  • 27 posts

Posted 20 March 2016 - 01:11 PM

motd looks fantastic, but I wonder how I can get rid of it ? as I do not need it?

just delete everything in /etc/update-motd.d


  • help40 likes this