My Feed Title Articles / Monitoring sur echosystem.fr 2020-05-23T00:23:23+02:00 Erreur32 https://echosystem.fr/articles/monitoring fail2web https://echosystem.fr/articles/monitoring/fail2web 2020-05-23T00:23:23+02:00 2020-05-23T00:23:23+02:00

Monitoring your fail2ban ban web GUI.

Source github : https://github.com/Sean-Der/fail2rest and https://github.com/Sean-Der/fail2web

While in theory it would be nice to have every network service behind a LAN/certificate that isn't always possible. Many protocols don't have certificate authentication, and even if they do maybe your client doesn't support it. So you are left with password authentication, but what happens when someone uses a 4 char password... and an attacker is able to guess 1000 times every minute? Seems like a complicated problem, but not with fail2ban! The following description is lifted from the fail2ban documentation.

However, once I installed fail2ban I found myself locking myself out of my servers all the time! I would setup a SIP client to use the wrong password, and would spend way to much time debugging what was wrong! With fail2web, that is all a thing of the past! fail2web is a mobile first GUI to fail2ban, that allows you to view who is currently banned, test regexes and view graphs on past bans.

You need have fail2rest and the necessary libraries.

Even though this tutorial is written for Ubuntu/Debian, it should work on any host that has Golang and fail2ban (All Unixes). You might have to deviate from this tutorial, but it should covert most of it.

First we need to install fail2rest, the daemon that communicates with fail2ban. The backend requires the Go programming language, and git to download it. If you have never used Go before you can follow this verbatim, adjust as needed if you already have a Gopath set.

  • sudo apt-get install golang git gcc

  • go get github.com/Sean-Der/fail2rest

  • cd $GOPATH/src/github.com/Sean-Der/fail2rest

  • sudo -E go run *.go Check the startup script for debian


If everything worked this program should just run forever! We will update it to run as a service later, but make sure it is working first. Run wget -qO- -- "localhost:5000/global/ping" if that returns "pong" you have a running fail2rest instance!

Next we are going to install fail2web in /var/www/fail2web, later we will access this via apache

  • git clone --depth=1 https://github.com/Sean-Der/fail2web.git /var/www/fail2web

Congrats, you are almost done! You now have all the moving parts, all that is left is to serve it via Apache

Install Apache and put it behind a password
  • sudo apt-get install apache2 apache2-utils

  • sudo htpasswd -c /var/www/htpasswd YOUR_USERNAME

  • sudo a2enmod proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html
Create your fail2web config

Then with your text editor of choice create /etc/apache2/sites-enabled/fail2web.conf with the following content. Make sure to replace fail2web.yourserver.name

     <VirtualHost *:80>  
  ServerName fail2web.yourserver.com ##CHANGE THIS  
  DocumentRoot /var/www/fail2web/web  

  <Location />  
      AuthType Basic  
      AuthName "Restricted"  
      AuthBasicProvider file  
      AuthUserFile /var/www/htpasswd  
      Require valid-user  

  </Location>  

 ProxyPass /api http://127.0.0.1:5000  

</VirtualHost> 
Restart Apache!

fail2web should now be accessible via the ServerName you chose above


#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:          fail2rest
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Should-Start:      fail2ban
# Should-Stop:       fail2ban
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: fail2rest initscript
# Description:       fail2rest is a small
#                    REST server that aims
#                    to allow full administration
#                    of a fail2ban server via HTTP
#
### END INIT INFO

USER="root"

#FIXME your GOPATH
GOPATH="YOUR/GOPATH/Projects/"

WORKDIR="/var/run/fail2ban"
#FIXME path to your fail2rest binary
DAEMON="$GOPATH/bin/fail2rest"
CONFIG="/etc/fail2rest.json"

# Author: Sean DuBois <sean@siobud.com>
#
DESC="fail2ban REST server"
NAME="fail2rest"

case "$1" in
      start)
        echo "Starting $NAME ..."
        if [ -f "$WORKDIR/$NAME.pid" ]
        then
            echo "Already running according to $WORKDIR/$NAME.pid"
            exit 1
        fi
        cd "$WORKDIR"
  export GOPATH="$GOPATH"
  export PATH="PATH=/usr/sbin:/usr/bin:/sbin:/bin:$GOPATH/bin"
        /bin/su -m -l root -c " $DAEMON --config $CONFIG" > "$WORKDIR/$NAME.log" 2>&1 &

        PID=$!
        echo $PID > "$WORKDIR/$NAME.pid"
        echo "Started with pid $PID - Logging to $WORKDIR/$NAME.log" && exit 0
        ;;
      stop)
        echo "Stopping $NAME ..."
        if [ ! -f "$WORKDIR/$NAME.pid" ]
        then
            echo "Already stopped!"
            exit 1
        fi
        PID=`cat "$WORKDIR/$NAME.pid"`
        kill $PID
        rm -f "$WORKDIR/$NAME.pid"
        echo "stopped $NAME" && exit 0
        ;;
      restart)
        $0 stop
        sleep 1
        $0 start
        ;;
      status)
        if [ -f "$WORKDIR/$NAME.pid" ]
        then
            PID=`cat "$WORKDIR/$NAME.pid"`
            if [ "$(/bin/ps --no-headers -p $PID)" ]
            then
                echo "$NAME is running (pid : $PID)" && exit 0
            else
                echo "Pid $PID found in $WORKDIR/$NAME.pid, but not running." && exit 1
            fi
        else
            echo "$NAME is NOT running" && exit 1
        fi
    ;;
      *)
      echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}" && exit 1
      ;;
esac

exit 0
]]>
vnstat https://echosystem.fr/articles/monitoring/vnstat 2020-05-02T15:55:00+02:00 2020-05-02T15:55:00+02:00

VNSTAT

Console moniteur de traffic et générateur graphique d'images (.png)

Installation de vnstat

Il existe deux varientes de vnstat, un mode console seulement et un mode avec géneration d'images.

Pour vnstat simple:

$ apt-get install vnstat 

Et vnstati pour générer les images:

apt-get install vnstati 

Generation des images

Pour génerer les images il suffit de placer un crontab pour chcune d'entre elles:

$  crontab -e

5 * * * *      vnstati -s -i eth0 -o  PATH/vnstat/summary.png >/dev/null 2>&1
2 * * * *      vnstati -h -i eth0 -o  PATH/vnstat/hourly.png      >/dev/null 2>&1
2 * * * *      vnstati -d -i eth0 -o  PATH/vnstat/daily.png        >/dev/null 2>&1
2 * * * *      vnstati -t -i eth0 -o   PATH/vnstat/top10.png      >/dev/null 2>&1
2 * * * *      vnstati -m -i eth0 -o PATH/vnstat/monthly.png   >/dev/null 2>&1
48 * * * *      /usr/bin/vnstat -u   >/dev/null 2>&1

Console mode

$ vnstat 1.18 by Teemu Toivola <tst at iki dot fi>

         -q,  --query          query database
         -h,  --hours          show hours
         -d,  --days           show days
         -m,  --months         show months
         -w,  --weeks          show weeks
         -t,  --top10          show top 10 days
         -s,  --short          use short output
         -u,  --update         update database
         -i,  --iface          select interface (default: eth0)
         -?,  --help           short help
         -v,  --version        show version
         -tr, --traffic        calculate traffic
         -ru, --rateunit       swap configured rate unit
         -l,  --live           show transfer rate in real time

See also "--longhelp" for complete options list and "man vnstat".
$ vnstat
                    rx      /      tx      /     total    /   estimated
 eth0:
    avril '20     440,80 GiB  /  699,11 GiB  /    1,11 TiB
       mai '20      2,14 GiB  /   35,65 GiB  /   37,79 GiB  /  703,76 GiB
     yesterday    951,90 MiB  /   20,86 GiB  /   21,79 GiB
         today      1,21 GiB  /   14,79 GiB  /   16,00 GiB  /   22,66 GiB

$ vnstat -t
eth0  /  top 10

    #      day          rx      |     tx      |    total    |   avg. rate
   -----------------------------+-------------+-------------+---------------
    1   27/03/2020   151,72 GiB |  264,26 GiB |  415,98 GiB |   41,36 Mbit/s
    2   01/04/2020    88,55 GiB |  260,02 GiB |  348,56 GiB |   34,65 Mbit/s
    3   07/11/2018   180,50 GiB |   49,25 GiB |  229,76 GiB |   22,84 Mbit/s
    4   01/01/2020   117,96 GiB |   99,26 GiB |  217,22 GiB |   21,60 Mbit/s
    5   28/11/2018    88,03 GiB |  126,89 GiB |  214,92 GiB |   21,37 Mbit/s
    6   25/12/2019   121,12 GiB |   80,72 GiB |  201,85 GiB |   20,07 Mbit/s
    7   13/11/2019   115,42 GiB |   85,39 GiB |  200,81 GiB |   19,96 Mbit/s
    8   02/01/2019   129,23 GiB |   55,08 GiB |  184,30 GiB |   18,32 Mbit/s
    9   07/08/2019   123,79 GiB |   58,85 GiB |  182,64 GiB |   18,16 Mbit/s
   10   21/09/2017   153,26 GiB |   26,35 GiB |  179,61 GiB |   17,86 Mbit/s
$  vnstat -h
 eth0                                                                     17:02
  ^               t
  |               t
  |            t  t
  |            t  t
  |            t  t
  |            t  t     t
  |         t  t  t     t     t           t                 t
  |   t     t  t  t  t  t     t  t        t                 t     t
  |   t     t  t  t  t  t     t  t        t  t     t        t     t
  |   t     t  t  t  t  t  t  t  t  t  t  t  t  t  t  t  t  t  t  t  t
 -+--------------------------------------------------------------------------->
  |  18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17

 h  rx (MiB)   tx (MiB)  ][  h  rx (MiB)   tx (MiB)  ][  h  rx (MiB)   tx (MiB)
18       33,3    1 080 ][ 02       41,2    1 508 ][ 10       17,7      359,9
19       11,9       85,7 ][ 03       27,2    1 064 ][ 11       22,7      645,7
20       42,7    1 531 ][ 04      247,0      520,0 ][ 12      161,3    1 656
21       78,9    3 092 ][ 05       16,0      535,6 ][ 13      110,7      583,0
22       85,2    3 514 ][ 06       41,8    1 476 ][ 14       90,5    1 127
23       31,6    1 133 ][ 07       27,1    1 048 ][ 15      175,9      685,0
00       45,2    1 787 ][ 08       18,2      535,2 ][ 16      164,8      120,9
01       15,6      531,6 ][ 09       18,9      963,2 ][ 17        1,2       13,2

History

vnStat is a console-based network traffic monitor that uses the network interface statistics provided by the kernel as information source. This means that vnStat won't actually be sniffing any traffic and also ensures light use of system resources. vnStat had an Initial public release in 23-Sep-2002 (version 1.0) by Teemu Toivola.

On 8 March 2004 its webpage moved to https://humdi.net/vnstat/ and a man page was included.

On 4 November 2006 was included in Debian for Testing Watch [4] and on 17 November 2006 was removed and next day was accepted 1.4-4 version.

On 20 February 2010 was accepted 1.10-0.1 version in Debian.[5] Nowadays Debian keeps a full history[6] about vnstat by using a Rich Site Summary.

On 26 April 2012 was included in Ubuntu 12.04 Precise Pangolin [7]

On 16 February 2017 a 1.17 version was released.[8]

Source: https://en.wikipedia.org/wiki/VnStat

]]>
Bashtop https://echosystem.fr/articles/monitoring/bashtop 2020-04-23T10:34:00+02:00 2020-04-23T10:34:00+02:00

bashtop

Usage: Linux resource monitor
Language: Bash

Description

Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

Features

  • Easy to use, with a game inspired menu system.
  • Fast and responsive UI with UP, DOWN keys process selection.
  • Function for showing detailed stats for selected process.
  • Ability to filter processes.
  • Easy switching between sorting options.
  • Send SIGTERM, SIGKILL, SIGINT to selected process.
  • UI menu for changing all config file options.
  • Auto scaling graph for network usage.
  • Shows message in menu if new version is available

Themes

Bashtop now has theme support and a function to download missing local themes from repository.

See themes folder for available themes.

Let me know if you want to contribute with new themes.

Upcoming

Currently rewriting to use python3 psutil for data collection instead of linux specific tools. This will add python 3 and psutil as dependencies, but will make bashtop cross platform compatible.

Please let me know if there is an interest in keeping current version without python dependencies alive.

Compability

Should work on most modern linux distributions with a truecolor capable terminal.

Dependencies

bash (v4.4 or later) Script functionality will most probably break with earlier versions.
Bash version 5 is higly recommended to make use of $EPOCHREALTIME variable instead of alot of external date command calls.

(Optional) curl (v7.16.2 or later) Needed if you want messages about updates and the ability to download themes.

Screenshots

Main UI showing details for a selected process.
Screenshot 1

Main menu.
Screenshot 2

Options menu.
Screenshot 3

Installation

Copy or link "bashtop" into PATH, or just run from cloned directory...

Also available in the AUR as bashtop-git

Also available for debian/ubuntu from Azlux's repository

Configurability

All options changeable from within UI. Config files stored in "$HOME/.config/bashtop" folder

bashtop.cfg: (auto generated if not found)

#? Config file for bashtop v. 0.8.0

#* Color theme, looks for a .theme file in "$HOME/.config/bashtop/themes", "Default" for builtin default theme
color_theme="Default"

#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs
update_ms="2500"

#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive"
#* "cpu lazy" upates sorting over time, "cpu responsive" updates sorting directly at a cpu usage cost
proc_sorting="cpu lazy"

#* Reverse sorting order, "true" or "false"
proc_reversed="false"

#* Check cpu temperature, only works if "sensors" command is available and have values for "Package" and "Core"
check_temp="true"

#* Draw a clock at top of screen, formatting according to strftime, empty string to disable
draw_clock="%R"

#* Update main ui when menus are showing, set this to false if the menus is flickering too much for comfort
background_update="true"

#* Custom cpu model name, empty string to disable
custom_cpu_name=""

#* Enable error logging to "$HOME/.config/bashtop/error.log", "true" or "false"
error_logging="true"

Command line options: (not yet implemented)

USAGE: bashtop

TODO

  • [x] TODO Add options to change colors for text, graphs and meters.
  • [ ] TODO Add options for resizing all boxes.
  • [ ] TODO Add command line argument parsing.
  • [ ] TODO Miscellaneous optimizations and code cleanup.
  • [ ] TODO Add more commenting where it's sparse.

LICENSE

Apache License 2.0

]]>
Goaccess https://echosystem.fr/articles/monitoring/goaccess 2018-04-09T18:29:00+02:00 2018-04-09T18:29:00+02:00

What is it?

GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.

It provides fast and valuable HTTP statistics for system administrators that require a visual server report on the fly.





Features

GoAccess parses the specified web log file and outputs the data to the X terminal. Features include:

  • Completely Real Time All panels and metrics are timed to be updated every 200 ms on the terminal output and every second on the HTML output.

  • No configuration needed You can just run it against your access log file, pick the log format and let GoAccess parse the access log and show you the stats.

  • Track Application Response Time Track the time taken to serve the request. Extremely useful if you want to track pages that are slowing down your site.

  • Nearly All Web Log Formats GoAccess allows any custom log format string. Predefined options include, Apache, Nginx, Amazon S3, Elastic Load Balancing, CloudFront, etc

  • Incremental Log Processing Need data persistence? GoAccess has the ability to process logs incrementally through the on-disk B+Tree database.

  • Only one dependency GoAccess is written in C. To run it, you only need ncurses as a dependency. That's it. It even has its own Web Socket server - http://gwsocket.io/.

  • Visitors Determine the amount of hits, visitors, bandwidth, and metrics for slowest running requests by the hour, or date.

  • Metrics per Virtual Host Have multiple Virtual Hosts (Server Blocks)? A panel that displays which virtual host is consuming most of the web server resources.

  • Color Scheme Customizable Tailor GoAccess to suit your own color taste/schemes. Either through the terminal, or by simply updating the stylesheet on the HTML output.

  • Support for large datasets GoAccess features an on-disk B+Tree storage for large datasets where it is not possible to fit everything in memory.

  • Docker support GoAccess comes with a default Docker (https://hub.docker.com/r/allinurl/goaccess/) that will listen for HTTP connections on port 7890. Although, you can still fully configure it, by using Volume mapping and editing goaccess.conf.

  • and more... visit https://goaccess.io for more details.

Why GoAccess?

GoAccess was designed to be a fast, terminal-based log analyzer. Its core idea is to quickly analyze and view web server statistics in real time without needing to use your browser (great if you want to do a quick analysis of your access log via SSH, or if you simply love working in the terminal).

While the terminal output is the default output, it has the capability to generate a complete real-time HTML report, as well as a JSON, and CSV report.

You can see it more of a monitor command tool than anything else.

Keys

The user can make use of the following keys:

  • ^F1^ or ^h^ Main help,
  • ^F5^ Redraw [main window],
  • ^q^ Quit the program, current window or module,
  • ^o^ or ^ENTER^ Expand selected module,
  • ^[Shift]0-9^ Set selected module to active,
  • ^Up^ arrow Scroll up main dashboard,
  • ^Down^ arrow Scroll down main dashboard,
  • ^j^ Scroll down within expanded module,
  • ^k^ Scroll up within expanded module,
  • ^c^ Set or change scheme color,
  • ^CTRL^ + ^f^ Scroll forward one screen within,
  • active module,
  • ^CTRL^ + ^b^ Scroll backward one screen within,
  • active module,
  • ^TAB^ Iterate modules (forward),
  • ^SHIFT^ + ^TAB^ Iterate modules (backward),
  • ^s^ Sort options for current module,
  • ^/^ Search across all modules,
  • ^n^ Find position of the next occurrence,
  • ^g^ Move to the first item or top of screen,
  • ^G^ Move to the last item or bottom of screen,

Examples can be found by running man goaccess.

]]>
linux-dash https://echosystem.fr/articles/monitoring/linux-dash 2018-04-07T12:09:00+02:00 2018-04-07T12:09:00+02:00

Linux-dash v2.0

A simple & low-overhead web dashboard for linux systems

Demo  |  Docs

Features

  • Small ----- Under 400KB on disk (with .git removed)!
  • Simple ---- A minimalist, beautiful dashboard
  • Easy ------ Drop-in installation
  • Versatile -- Choose your stack from Node.js, Go, Python, PHP

Installation

Step 1

## 1. clone the repo
git clone --depth 1 https://github.com/afaqurk/linux-dash.git

## 2. go to the cloned directory
cd linux-dash/app/server

OR, if you prefer to download manually:

## 1. Download the .zip
curl -LOk https://github.com/afaqurk/linux-dash/archive/master.zip && unzip master.zip

## 2. navigate to downloaded & unzipped dir
cd linux-dash-master/app/server

Step 2

See instructions for preferred server linux-dash server (all included):

If Using Node.js

## install dependencies
npm install --production

## start linux-dash (on port 80 by default; may require sudo)
## You may change this with the `LINUX_DASH_SERVER_PORT` environment variable (eg. `LINUX_DASH_SERVER_PORT=8080 node server`)
## or provide a --port flag to the command below
node index.js

If Using Go

## start the server (on port 80 by default; may require sudo)
go run index.go

To build a binary, run go build && ./server -h. See @tehbilly's notes here for binary usage options

If Using Python

# Start the server (on port 80 by default; may require sudo).
python index.py

If Using PHP

  1. Make sure you have the exec, shell_exec, and escapeshellarg functions enabled
  2. Point your web server to app/ directory under linux-dash
  3. Restart your web server (Apache, nginx, etc.)

Support

For general help, please use the Gitter chat room.

Security

It is strongly recommended that all linux-dash installations be protected via a security measure of your choice.

Linux Dash does not provide any security or authentication features.

]]>
munin https://echosystem.fr/articles/monitoring/munin 2018-04-07T11:56:00+02:00 2018-04-07T11:56:00+02:00

Munin

Installing Munin

You will need to install "munin-master" on the machine that will collect data from all nodes, and graph the results. When starting with Munin, it should be enough to install the Munin master on one server.

The munin master runs :ref:munin-httpd which is a basic webserver which provides the munin web interface on port 4948/tcp.

Install "munin-node" on the machines that shall be monitored by Munin. Install "munin-client" on the machines that have web poge monitoring.

Source or packages?

With open source software, you can choose to install binary packages or install from source-code.

We `strongly` recommend a packaged install, as the source distribution isn't as tested as the packaged one. The current state of the packages is so satisfactory, that even the developers use them instead.

Installing Munin on most relevant operating systems can usually be done with the systems package manager, typical examples being:

Installing Munin from a package

Debian/Ubuntu

Munin is distributed with both Debian and Ubuntu.

In order to get Munin up and running type

 $ sudo apt-get install munin-node

on all nodes, and

 $ sudo apt-get install munin

on the master.

Please note that this might not be the latest version of Munin. On Debian you have the option of enabling "backports", which may give access to later versions of Munin.

Link Project: http://munin-monitoring.org/

]]>
monitorix https://echosystem.fr/articles/monitoring/monitorix 2018-04-06T15:24:00+02:00 2018-04-06T15:24:00+02:00

Monitorix web tool

Installation Monitorix

Via the repository

# apt-get update
# apt-get install monitorix

Manually

downloading first the package and taking care for dependencies, and finally installing it.

# apt-get update
# apt-get install rrdtool perl libwww-perl libmailtools-perl libmime-lite-perl \
librrds-perl libdbi-perl libxml-simple-perl libhttp-server-simple-perl \ 
libconfig-general-perl libio-socket-ssl-perl
# dpkg -i monitorix*.deb
# apt-get -f install

Configuring Monitorix

Monitorix ships with a default configuration file which works out-of-the-box. Moreover, the service is automatically started on package installation.

To fine-tune your installation, take a look at the /etc/monitorix/monitorix.conf file (and optionally the documentation) to adjust some things (like network interfaces, filesystems, disks, etc.).

IMPORTANT NOTICE:
The Debian package also comes with an extra configuration file in /etc/monitorix/conf.d/00-debian.conf that includes some options specially adapted for Debian systems.
This file will be loaded right after the main configuration file, hence some options in the main configuration will be overwritten by this extra file.

When you are done, restart Monitorix to let your changes take effect:

service monitorix restart

Link official : http://www.monitorix.org

Enjoy!

]]>
netdata https://echosystem.fr/articles/monitoring/netdata 2018-04-06T15:22:00+02:00 2018-04-06T15:22:00+02:00

Build Status Codacy Badge Code Climate License: GPL v3+

New to netdata? Here is a live demo: http://my-netdata.io

netdata is a system for distributed real-time performance and health monitoring. It provides unparalleled insights, in real-time, of everything happening on the system it runs (including applications such as web and database servers), using modern interactive web dashboards.

netdata is fast and efficient, designed to permanently run on all systems (physical & virtual servers, containers, IoT devices), without disrupting their core function.

netdata runs on Linux, FreeBSD, and MacOS.


$  apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl jq nodejs

image10

For all Linux systems, you can use this one liner to install the git version of netdata:

# basic netdata installation
$ bash <(curl -Ss https://my-netdata.io/kickstart.sh)

# install required packages for all netdata plugins
$ bash <(curl -Ss https://my-netdata.io/kickstart.sh) all

The above:

$ bash <(curl -Ss https://my-netdata.io/kickstart.sh) all --dont-wait --dont-start-it

You can install a pre-compiled static binary of netdata for any Intel/AMD 64bit Linux system (even those that don't have a package manager, like CoreOS, CirrOS, busybox systems, etc). You can also use these packages on systems with broken or unsupported package managers.

To install the latest version use this:

$ bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh)

For automated installs, append a space + --dont-wait to the command line. You can also append --dont-start-it to prevent the installer from starting netdata. Example:

$ bash <(curl -Ss https://my-netdata.io/kickstart-static64.sh) --dont-wait --dont-start-it

If your shell fails to handle the above one liner, do this:

# download the script with curl
$ curl https://my-netdata.io/kickstart-static64.sh >/tmp/kickstart-static64.sh

# or, download the script with wget
$ wget -O /tmp/kickstart-static64.sh https://my-netdata.io/kickstart-static64.sh

# run the downloaded script (any sh is fine, no need for bash)
$ sh /tmp/kickstart-static64.sh

The static builds install netdata at /opt/netdata.

The static binary files are kept in this repo: https://github.com/firehol/binary-packages

Download any of the .run files, and run it. These files are self-extracting shell scripts built with makeself.

The target system does not need to have bash installed.

The same files can be used for updates too.

$  cd /opt
$  git clone https://github.com/firehol/netdata.git netdata --depth=1
$  cd netdata
$  ./netdata-installer.sh

netdata


netdata collects several thousands of metrics per device. All these metrics are collected and visualized in real-time.

Almost all metrics are auto-detected, without any configuration.

This is a list of what it currently monitors:

  • CPU
    usage, interrupts, softirqs, frequency, total and per core, CPU states

  • Memory
    RAM, swap and kernel memory usage, KSM (Kernel Samepage Merging), NUMA

  • Disks
    per disk: I/O, operations, backlog, utilization, space, software RAID (md)

    sda

  • Network interfaces
    per interface: bandwidth, packets, errors, drops

    dsl0

  • IPv4 networking
    bandwidth, packets, errors, fragments, tcp: connections, packets, errors, handshake, udp: packets, errors, broadcast: bandwidth, packets, multicast: bandwidth, packets

  • IPv6 networking
    bandwidth, packets, errors, fragments, ECT, udp: packets, errors, udplite: packets, errors, broadcast: bandwidth, multicast: bandwidth, packets, icmp: messages, errors, echos, router, neighbor, MLDv2, group membership, break down by type

  • Linux DDoS protection
    SYNPROXY metrics

  • fping latencies
    for any number of hosts, showing latency, packets and packet loss

    image

  • Processes
    running, blocked, forks, active

  • Entropy
    random numbers pool, using in cryptography

qos-tc-classes

  • Applications
    by grouping the process tree and reporting CPU, memory, disk reads, disk writes, swap, threads, pipes, sockets - per group

    apps

  • Users and User Groups resource usage
    by summarizing the process tree per user and group, reporting: CPU, memory, disk reads, disk writes, swap, threads, pipes, sockets

  • Apache and lighttpd web servers
    mod-status (v2.2, v2.4) and cache log statistics, for multiple servers

  • statsd
    netdata is a fully featured statsd server

  • ceph
    OSD usage, Pool usage, number of objects, etc.

And you can extend it, by writing plugins that collect data from any source, using any computer language.


Check the netdata wiki.

netdata is GPLv3+.

It re-distributes other open-source tools and libraries. Please check the third party licenses.

]]>
eZ Server Monitor https://echosystem.fr/articles/monitoring/ez-server-monitor 2018-04-06T11:58:00+02:00 2018-04-06T11:58:00+02:00

eZ Server Monitor `Web

Version Web, eZ Server Monitor est un script PHP:

eZ Server Monitor `sh

Version Bash (eSM`sh), pour terminal Unix.

Link project: http://www.ezservermonitor.com/esm-web/downloads

Installation:

PHP - https://github.com/shevabam/ezservermonitor-web

SH - https://github.com/shevabam/ezservermonitor-sh

]]>
glances https://echosystem.fr/articles/monitoring/glances 2018-04-06T11:40:00+02:00 2018-04-06T11:40:00+02:00

Glances

Monitoring #Bash

Glances Auto Install script

To install the latest Glances production ready version, just enter the following command line:

$ curl -L https://bit.ly/glances | /bin/bash

or

$ wget -O- https://bit.ly/glances | /bin/bash

Note: Only supported on some GNU/Linux distributions.

Glances is on PyPI. By using PyPI, you are sure to have the latest stable version.

To install, simply use pip:

$ pip install glances

Others methods ? Read the official installation documentation.

]]>
htop https://echosystem.fr/articles/monitoring/htop 2018-04-06T11:03:00+02:00 2018-04-06T11:03:00+02:00

HTOP

htop est un moniteur système pour les systèmes d’exploitation type Unix très similaire à top, qui fonctionne comme lui en mode Terminal, mais qui dispose d'un environnement en mode texte plus convivial (et coloré) que ce dernier.

Il est programmé en C à l'aide de la bibliothèque ncurses.

Installtion via apt-get :

$ apt-get install htop

TIPS:

  • Changer le style d’affichage LED Bar Text ou Graph , appuyer sur la barre d’espace clavier une fois sur l’élément choisi. !

  • Require: librairie Ncurses 6

    $ apt-get  install libncurses5-dev libncursesw5-dev 
]]>
gtop https://echosystem.fr/articles/monitoring/gtop 2018-04-06T10:59:00+02:00 2018-04-06T10:59:00+02:00

GTOP

GTOP System monitoring dashboard for terminal.

Requirements

  • Linux / OSX / Windows (partial support)
  • Node.js >= v4

Installation

$ npm install gtop -g

Usage

You can sort the process table by pressing

  • p: Process Id
  • c: CPU usage
  • m: Memory usage

Troubleshooting

If you see question marks or other different characters, try to run it with these environment variables:

$ LANG=en_US.utf8 TERM=xterm-256color gtop

License

Released under the MIT license.

Link Project: https://github.com/aksakalli/gtop/

]]>
s-tui https://echosystem.fr/articles/monitoring/s-tui 2018-04-06T10:43:00+02:00 2018-04-06T10:43:00+02:00

s-tui

s-tui is a terminal UI for monitoring your computer. s-tui allows to monitor CPU temperature, frequency, power and utilization in a graphical way from the terminal.

The Stress Terminal UI: s-tui

Project: https://github.com/amanusk/s-tui

Screenshot

What it does

  • Monitoring your CPU temperature/utilization/frequency/power
  • Shows performance dips caused by thermal throttling
  • Requires minimal resources
  • Requires no X-server
  • Built in options for stressing the CPU (stress/stress-ng)

Usage

s-tui

or

sudo s-tui

Simple installation

pip (x86 + ARM)

The most up to date version of s-tui is available with pip

sudo pip install s-tui

Or if you cannot use sudo:

pip install s-tui --user

If you are installing s-tui on a Raspberry-Pi you might need to install python-dev first

Options

********s-tui manual********
usage: s_tui.py [-h] [-d] [-c] [-t] [-j] [-nm] [-v] [-ct CUSTOM_TEMP]

TUI interface:

The side bar houses the controls for the displayed grahps.
At the bottom of the side bar, more information is presented in text form.

* Use the arrow keys or 'hjkl' to navigate the side bar
* Toggle between stressed and regular operation using the radio buttons in 'Modes'.
* If you wish to alternate stress defaults, you can do it in 'Stress options'
* Select a different temperature sensors from the 'Temp Sensors' menu
* Change time between updates using the 'Refresh' field
* Use the 'Reset' button to reset graphs and statistics
* Toggle displayed graphs by selecting the [X] check box
* If a sensor is not available on your system, N/A is presented
* If your system supports it, you can use the utf8 button to get a smoother graph
* Press 'q' or the 'Quit' button to quit

* Run `s-tui --help` to get this message and additional cli options

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Output debug log to _s-tui.log
  -c, --csv             Save stats to csv file
  -t, --terminal        Display a single line of stats without tui
  -j, --json            Display a single line of stats in JSON format
  -nm, --no-mouse       Disable Mouse for TTY systems
  -v, --version         Display version
  -ct CUSTOM_TEMP, --custom_temp CUSTOM_TEMP

                        Custom temperature sensors.
                        The format is: <sensors>,<number>
                        As it appears in 'sensors'
                        e.g
                        > sensors
                        it8792-isa-0a60,
                        temp1: +47.0C
                        temp2: +35.0C
                        temp3: +37.0C

                        use: -ct it8792,0 for temp 1

  -cf CUSTOM_FAN, --custom_fan CUSTOM_FAN
                        Similar to custom temp
                        e.g
                        >sensors
                        thinkpad-isa-0000
                        Adapter: ISA adapter
                        fan1:        1975 RPM

                        use: -cf thinkpad,0 for fan1

Dependencies

s-tui is a great tool for monitoring. If you would like to stress your computer, install stress. Stress options will then show up in s-tui (optional)

sudo apt-get install stress

Configuration

s-tui is a self-contained application which can run out-of-the-box and doesn't need config files to drive its core features. However, additional features like running scripts when a certain threshold has been exceeded (e.g. CPU temperature) does necessitate creating a config directory. This directory will be made in ~/.config/s-tui by default.

Adding threshold scripts

s-tui gives you the ability to run arbitrary shell scripts when a certain threshold is surpassed, like your CPU temperature. You can define this custom behaviour by adding a shell file to the directory ~/.config/s-tui/hooks.d with one of the following names, depending on what threshold you're interesting in reacting to:

  • temperaturesource.sh: triggered when the CPU temperature threshold is exceeded

If s-tui finds a script in the hooks directory with the name of a source it supports, it will run that script every 30 seconds as long as the current value of the source remains above the threshold.

Note that at the moment only CPU temperature threshold hooks are supported.

More installation methods

Ubuntu

The latest stable version of s-tui is available via pip. To install pip on Ubuntu run:
sudo apt-get install gcc python-dev python-pip
Once pip is installed, install s-tui from pip:
(sudo) pip install s-tui

A deprecated ppa is available (tested on Ubuntu 16.04)

sudo add-apt-repository ppa:amanusk/python-s-tui
sudo apt-get update
sudo apt-get install python-s-tui

Arch-Linux

AUR packages of s-tui are available

s-tui is the latest stable release version. Maintined by @DonOregano
s-tui-git follows the master branch. maintained by @MauroMombelli
install with
(sudo) yaourt -S s-tui

Run source code

Running s-tui from source
Clone

git clone https://github.com/amanusk/s-tui.git

Install dependencies, these need to be installed to run s-tui.py

(sudo) pip install urwid
(sudo) pip install psutil

Install stress (optional)

sudo apt-get install stress

Run the .py file

(sudo) python -m s_tui.s_tui

OPTIONAL integration of FIRESTARTER (via submodule, does not work on all systems)

FIRESTARTER is a great tool to stress your system to the extreme. If you would like, you can integrate FIRESTARTER submodule into s-tui. To build FIRESTARTER

git submodule init
git submodule update
cd ./FIRESTARTER
./code-generator.py
make

Once you have completed these steps, you can either:

  • Install FIRESTARTER to make it accessible to s-tui, e.g make a soft-link to FIRESTARTER in /usr/local/bin.
  • Run s-tui from the main project directory with python -m s_tui.s_tui
    An option to run FIRESTARTER will then be available in s-tui

Compatibility

s-tui uses psutil to probe some of your hardware information. If your hardware is not supported, you might not see all the information.

  • On Intel machines:
    Running s-tui as root gives access to the maximum Turbo Boost frequency available to your CPU when stressing all cores. Running without root will display the Turbo Boost available on a single core.

  • Power read is supported on Intel Core CPUs of the second generation and newer (Sandy Bridge)

  • s-tui tested to run on Raspberry-Pi 3,2,1

Q&A

Q: How is this different from htop?
A: s-tui is not a processes monitor like htop. The purpose is to monitor your CPU statistics and have an option to test the system under heavy load. (Think AIDA64 stress test, not task manager).

Q: What features require sudo permissions?
A: Top Turbo frequency varies depending on how many cores are utilized. Sudo permissions are required in order to accurately read the top frequency when all the cores are utilized.

Q: I don't have a temperature graph
A: Systems have different sensors to read CPU temperature. If you do not see a temperature read, your system might not be supported (yet). You can try manually setting the sensor with the cli interface (see --help), or selecting a sensor from the 'Temp Sensors' menu

Q: I have a temperature graph, but it is wrong.
A: A default sensor is selected for temperature reads. On some systems this sensor might indicate the wrong temperature. You can manually select a sensor from the 'Temp Sensors' menu or using the cli interface (see --help)

Q: I am using the TTY with no X server and s-tui crashes on start
A: By default, s-tui is handles mouse inputs. This causes some systems to crash. Try running s-tui --no-mouse

]]>