markedphillips / cloudshell-nmon

Nmon customized for xu4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

---[ Overview ] -------------------------------------------------------------------------------
What is this?!?  This project is making nmon fit on the 320x240 LCD screen on an Odroid Cloudshell 2.  As well modify NMON to support reading the Xu4 CPU temperature, A7 and A15 clock speeds.  Making this fit on the screen requires using a small font called miniwi-8.  It's included in this repo (miniwi-8.psf.gz)
Font Origin:  https://github.com/josuah/miniwi

Other modifications were done to optimize NMON readability on the small screen/font.

I did this project because the CLOUDSHELL-LCD shell script took up too much CPU at about 20% of one core.  As well it was missing a lot of stats I wanted.  NMON doesn't take up any noticable ammount of CPU :)  And provides a lot more information.  Granted you need to be in front of the unit to see it, lol.  I color coded as much as possible so from a distance you can see something is wrong; which then in turn you can take a look.

TODO:
Update 'f' free memory option I added to be color coded.


--- [ Files ] ---------------------------------------------------------------------------------
cloudshell-nmon		This script will set the small font,terminal and get the app running on 
			/dev/tty8 (unused console).  Change the LCD to console 8 to display nmon-xu4.
			Choose startup display options for nmon.

cloudshell-nmon.deb	Debian package compiled for Xu4; it includes everything needed to run the app.
			Sets app to startup automatically.  Please see my NOTES below before using.

lmon.c			C source of NMON modified/tweaked for Xu4

makefile		makefile to build

miniwi-8.psf.gz		Tiny font!

nmon-xu4		ARMv7 binary compiled from lmon.c source


--- [ Installing debian package ] -------------------------------------------------------------
Please see my notes below before using the package :)  If you have the Odroid recommended OS installed this package is all you need.  As well it might be compatible with other ARM based debian system.  Be sure to read the section on running the shell script after installing as well.

   $sudo dpkg -i cloudshell-nmon.deb


--- [ Building ] ------------------------------------------------------------------------------
To compile this you will need ncurses-dev installed.
To build simply type "make" with the repo after you have pulled it.


--- [ Manual Install ] ------------------------------------------------------------------------
1) copy the font file (miniwi-8.psf.gz) into /usr/share/consolefonts
     $sudo cp miniwi-8.psf.gz /usr/share/consolefonts
2) Make nmon-xu4 binary executable (skip if you compiled yourself)
     $sudo chmod 755 nmon-xu4
2) copy nmon-xu4 binary to /usr/local/bin
     $sudo cp nmon-xu4 /usr/local/bin
2) Make the shell script executable
     $sudo chmod 755 cloudshell-nmon
3) Copy cloudshell-nmon script to /usr/local/bin
     $sudo cp cloudshell-nmon /usr/local/bin
4) Add the shell script to your startup (universal way)
   Edit /etc/rc.local and add the following line to the end
     /usr/local/bin/cloudshell-nmon&


--- [ Running shell script] -------------------------------------------------------------------
If you have installed the debian package it will auto start when you reboot but you can also use the commands

To start service
   $sudo service cloudshell-nmon start

to stop service
   $sudo service cloudshell-nmon stop

If you have done a manual install you can reboot or run the command manually detaching it from your current tty with...
   $sudo nohup cloudshell-nmon 2>&1 >/dev/null &


--- [ What about my console? ] ----------------------------------------------------------------
Unlike cloudshell-lcd I dont just overwrite your 1st console screen (/dev/tty1).  Instead I use console #8 (/dev/tty8) which is not used.  To switch consoles in Linux just hold down ALT and hit a Function key.  To get to console #1 hit ALT + F1 ; to return to NMON-Xu4 on console #8 hit ALT + F8.  **Note these key combinations are only applicable to a local keyboard connected to the Xu4.


--- [ Usage ] ---------------------------------------------------------------------------------
ALL of this assumes you have the Cloudshell LCD working via it's module: fb_ili9340.  Now you can use the nmon-xu4 without the module to run in terminal; if that is all you want all you need is the binary file.


--- [ NOTES ] ---------------------------------------------------------------------------------
If you have cloudshell-lcd installed and running it might conflict with my package since it autostarts.  However it might not since I run on console 8. If someone lets me know I'll update this :)   If it does you will need to do either A or B below.  

A) Disable cloudshell-lcd via
   $sudo service cloudshell-lcd stop
   $sudo systemctl disable cloudshell-lcd.service 

B) Remove the cloudshell-lcd package  (this will not harm anything else other than it removes the LCD shell script)
   $sudo dkg --remove cloudshell-lcd


--- [ Questions? ] ----------------------------------------------------------------------------
https://forum.odroid.com/viewtopic.php?f=147&t=29996


--- [ CHANGELOG ] -----------------------------------------------------------------------------
Added option command 'x'  for Xu4 Temperature and CPU
Added option command 'f' to show memory free like 'free' command does
Modified 'd/D' function to supress the 'boot' devices (don't care to waste space seeing these).
Modified source to not output the network errors on start
Tweaked color/formatting

About

Nmon customized for xu4


Languages

Language:C 99.7%Language:Shell 0.2%Language:Makefile 0.1%