Hardware Monitoring on Linux

Higher level console tools that assist in system administration:

  • nmon – systems administrator, tuner, benchmark tool
  • atop – AT Computing’s System & Process Monitor
  • powertop – a power consumption and power management diagnosis tool
  • bmon – bandwidth monitor and rate estimator; displays the current network usage
  • wavemon – monitor nearby WiFi networks


18 commands to monitor network bandwidth on Linux server

Test read/write speed of usb and ssd drives with dd command on Linux


ElasticSearch 2 stack on Odroid / Ubuntu 15

This post covers setting up ELK 2.0 stack on Odroid XU3-Lite Ubuntu 15 (ARM)


  • using official Java from Oracle (8, armv6_vfp_hflt)
  • ElasticSearch: 2.0, Kibana 4.2.0, Logstash 2.0
  • Kibana libjffi-1.2.so still doesn’t work for Odroid / Open JDK 7,8

Java had to be installed from Oracle in order to work with Kibana. Open JDK 7 failed with segfault. Open JDK 8 didn’t start Kibana

  • #export JAVA_HOME=.../jre

ElasticSearch installation was fairly straightforward

Kibana was bit complex, due to lack of binaries for ARM arch and Node.js requirement

  • download 4.2.x, https://www.elastic.co/downloads/kibana
  • as there are no binaries on the homepage, so I went for git master branch (4.3.0 at time of writing)
    • git clone https://github.com/elastic/kibana
  • latest master doesn’t work with ElasticSearch < 2.1, so I had to roll back sources manually to v4.2.0 (as this one is compatible with ES 2.0 being installed above)
    • cd kibana; git checkout v4.2.0
  • Kibana requires node.js. That somehow is not communicated in README

Logstash was a pain to install on previous Odroid Ubuntu, and same problem appear again


Delete all data from Elastic Search

curl -XDELETE 'http://localhost:9200/_all'

Make Logstash parse stdin

#cat logstash-cpu_temp-to-es.conf
input {
 stdin { }

filter {
 grok {
   match => { message => "created_at:%{NUMBER:created_at:int},sensor:%{WORD:sensor},temperature:%{NUMBER:temperature:int}" }
  date { match => ["created_at", "UNIX"] }
output {
 stdout { codec => dots }
 elasticsearch { hosts => ["localhost:9200"] }
sudo ~/bin/my.ls.odroid.cpu_temp.sh | ./bin/logstash -f logstash-monitocpu_temp-to-es.conf

Shared directory over network of few Raspberry PIs, Odroid and a laptop


  • how to have a directory of files transparently synced between many servers
  • How to setup GlusterFS on 2 Raspberry PIs, Odroid and Linux PC
  • Had to use same version (3.6.x) everywhere; compiled from sources
  • have a backup as a side effect :-)


When working with multiple servers I had a need to have 1 directory available on each machine that could be shared among all servers. It should be automatically synchronized when server boots up. Each file modification/creation should be pushed to other servers too.

The storage itself should be redundant – backup for “free”. When all-but-one server dies: I still can access and modify files.


I will use distributed filesystem: GlusterFS. Meant for high volume traffic.
I will use it to share 10MB of ~/etc and ~/bin/ only ;-)


Raspberry PI 1 hostname: rpi-0, OS: Raspbian
Raspberry PI 2 hostname: rpi-2, OS: Raspbian
Odroid XU3 Lite, hostname: odroid, OS: Ubuntu 14
Laptop PC, OS: Debian Jessie

APT vs ./configure && make && make install

Unfortunately GlusterFS packages that come with Raspbian (R PI OS) and Ubuntu 14 (Odroid) and Debian Jessie are completely different in versions (3.2.x, 3.4.x). They’re all 3.x and install & run fine. However Odroid version wasn’t able to mount remote filesystem. I had to abandon using system packages in order not to waste any more time.

GlusterFS 3.7.x source code on Raspberry didn’t work with one dependency (liburcu), so I’ve used 3.6.x release with success.


Install the latest 3.6.x release


Install dependencies

sudo apt-get install libacl1-dev flex bison libreadline6-dev libxml2-dev libxml2 liburcu-dev liburcu1 python-dev make gcc flex bison libssl-dev liblvm2-dev libglib2.0-dev libxml2-dev python2.7 python2.7-dev autoconf libtool attr


./configure --prefix=/site/apps/glusterfs-3.6/ && make && sudo make install
ln -s /site/apps/glusterfs-3.6/ /site/apps/glusterfs/

Compilation took:

  • 75 min on Raspberry PI 1
  • 26 min on Raspberry PI 2
  • 4 min on Odroid XU3
  • 2 min on Intel i7

Setup GlusterFS

mkdir -p /site/apps/glustervol #glusterfs server storage, not meant for direct access
mkdir /mnt/glusterfs/          #mount point of gluster filesystem, you put your files here
sudo export PATH=$PATH:/site/apps/glusterfs/bin/:/site/apps/glusterfs/sbin/                       #you might put it in /etc/profile or visudo (secure_path)
sudo update-rc.d glusterd defaults

sudo /etc/init.d/glusterd start #on every machine, or simply reboot

Setup pool of GlusterFS servers

In order to distribute data (files) accross multiple GlusterFS severs and support failover (in case some servers are down, files are still accessible):

sudo gluster peer probe rpi-2
sudo gluster peer probe odroid
sudo gluster peer probe rpi-0
sudo gluster peer info  #you should see all machines except host

 Create distributed volume

sudo gluster volume create glustervol replica 3 transport tcp rpi-0:/site/apps/glustervol/ rpi-2:/site/apps/glustervol/ odroid:/site/apps/glustervol/ force
sudo gluster volume start glustervol
sudo gluster volume info

Mount on remote machines

sudo mount.glusterfs rpi-0,rpi-2,odroid:/glustervol /mnt/glusterfs/

Mount on startup in /etc/fstab:

rpi-0,rpi-2,odroid:/glustervol /mnt/glusterfs/ glusterfs defaults,nofail,_netdev 0 0

The way it’s mounted (several hostnames provided) will prevail situations when some of nodes are down. Mounted files will be transparently remounted to other available node. Wow!