[null, {"document_url": "http://epsi-rns.github.io/code/2016/06/15/monitoring-script.html", "unformatted_src": "http://epsi-rns.github.io/assets/posts/opensource/2016/06/monitoring-script.png", "src": "http://epsi-rns.github.io/assets/posts/opensource/2016/06/monitoring-script.png", "formatted_filename": "monitoring script", "alt_text": "BASH Monitoring Script"}, null, {"document_url": "http://epsi-rns.github.io/code/2016/06/15/monitoring-script.html", "unformatted_src": "http://epsi-rns.github.io/assets/site/images/authors/epsi-vexel.png", "src": "http://epsi-rns.github.io/assets/site/images/authors/epsi-vexel.png", "formatted_filename": "epsi vexel", "alt_text": "Epsi Nurwijayadi bio photo", "rendered_width": 120, "rendered_height": 110}, null]


Somebody asked in Debian group about speed monitoring application. There is a good application for this called conky or watch.

Conky is good for desktop decoration. And watch is pretty in Console. For a lightweight portable script, you need to consider to remove any conky/watch dependency.

Actually we can simplified the process for our own use. Using bash script only, and get rid of conky, to make our monitoring script more transparent.

Monitor in loop

The basic of monitoring is pool a data result for each monitoring interval.

You can do this from bash with this simple while loop.

I know it is weird to have a date while sleeping.

Sample Script, Net Speed

I remember two months ago I have found bash script, combined with answer from stackoverflow, I have rewritten this script for my own purpose.

This script utilize statistic form /sys/class/net/ for dzen2 feed.



With slight modification. I remove the dzen stuff. And change the echo to printf. And prepend carriage return.

Complete Script

You can see the result in figure below Now you can use, modify, and extend this script for your own purpose.
 By Epsi Nurwijayadi
Share: Tweet Like +1


system   opensource   desktop   design   code   webdev



