You are on page 1of 14

Cómo monitorizar un sistema GNU/Linux

en 5 minutos

Netdata es un demonio que corre sobre Linux y que ofrece monitorización a tiempo real
tanto del propio sistema operativo como de aplicaciones y soporte SNMP. Todo ello a
través de una interfaz web muy amigable que muestra un dashboard personalizable con
toda la información a golpe de click. Netdata está escrito en C y su optimización permite
que utilice apenas unos MB de RAM y un pequeño porcentaje de ciclos de CPU.

Cuando digo que se instala en menos de 5 minutos es porque únicamente tiene unas pocas
dependencias y la instalación se realiza a través de un único script ejecutable que
realiza todas las tareas de compilación e instalación. También cuenta con una API para la
creación de plugins e integración con aplicaciones/servicios.

Instalación de netdata

Para instalar netdata, primero revisamos las dependencias:

Debian y derivados:

# apt-get install zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf


autogen automake pkg-config
# Opcionales
# apt-get install curl jq nodejs

RHEL, CentOS y derivados:


# yum install zlib-devel libuuid-devel libmnl-devel gcc make git autoconf
autogen automake pkgconfig
# Opcionales
# yum install curl jq nodejs

Para instalarlos, descargamos desde git y ejecutamos el instalador:

# git clone https://github.com/firehol/netdata.git --depth=1


# cd netdata
# ./netdata-installer.sh
Welcome to netdata!
Nice to see you are giving it a try!

You are about to build and install netdata to your system.

It will be installed at these locations:

- the daemon at /usr/sbin/netdata


- config files at /etc/netdata
- web files at /usr/share/netdata
- plugins at /usr/libexec/netdata
- cache files at /var/cache/netdata
- db files at /var/lib/netdata
- log files at /var/log/netdata
- pid file at /var/run

This installer allows you to change the installation path.


Press Control-C and run the same command with --help for help.

Press ENTER to build and install netdata to your system >


[...]

-------------------------------------------------------------------------
------

OK. NetData is installed and it is running (listening to *:19999).

-------------------------------------------------------------------------
------

Hit http://localhost:19999/ from your browser.

To stop netdata, just kill it, with:

killall netdata

To start it, just run it:

Tras la instalación el demonio levanta automáticamente:

# ps -fu netdata
UID PID PPID C STIME TTY TIME CMD
netdata 18283 1 2 11:01 ? 00:00:21 /usr/sbin/netdata -
pidfile /var/run/netdata.pid
netdata 18290 18283 1 11:01 ? 00:00:14 /bin/bash
/usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1
netdata 18292 18283 3 11:01 ? 00:00:27
/usr/libexec/netdata/plugins.d/apps.plugin 1
netdata 18294 18283 11 11:01 ? 00:01:18 /bin/bash
/usr/libexec/netdata/plugins.d/charts.d.plugin 1
netdata 26066 18294 0 11:13 ? 00:00:00 /bin/date +%s * 1000 + %-
N / 1000000
netdata 26067 18290 0 11:13 ? 00:00:00 /bin/bash
/usr/libexec/netdata/plugins.d/tc-qos-helper.sh 1
Acceso web

Ya podemos acceder a la interfaz web (http://$IP_SERVIDOR:19999/) y disfrutar de la


monitorización: cpu, red, memoria, disco, procesos, servicios, netfilter… de primeras, entre
otras cosas netdata monitoriza todo lo que se puede extraer del sistema de archivos
virtual /proc, así que imaginaros toda la información que disponemos sin necesidad de
configurar nada. Además, establece relación entre todas las métricas. También presentará
los servicios activos y monitorizará lo que detecte de cada uno (MySQL, Postfix, Apache,
etc).

Netdata: Herramienta de monitorización


para linux
Netdata nos monitorizará:

-Utilización de la CPU (cores)


-Monitoriza Procesos (en ejecución, bloqueados, activos, etc)
-Utilización de Memoria RAM,SWAP
-Monitoriza las interfaces de red (ancho de banda, errores, paquetes, etc)
-Monitoriza las conexiones a Netfilter ,Iptables (eventos ,errores, etc)
-Estado de Apache y Nginx (con mod_status)
-Monitoriza el estado de MySQL (queries,updates,locks,problemas etc)
-Cola del servidor de email Postfix
-Monitoriza el ancho de banda del servidor proxy Squid
-Dispositivos que tengan activado SNMP
-Sensores (temperatura,ventiladores,voltage,humedad etc)

Instalación en Debian/Ubuntu

Para instalar netdata en el equipo tendremos que tener los siguientes paquetes:

apt-get install zlib1g-dev gcc make git autoconf autogen automake pkg-
config

Clonamos netdata desde el repositorio con git

git clone https://github.com/firehol/netdata.git --depth=1


entramos en la carpeta creada para netdata y ejecutamos el script para la instalación.

cd netdata
./netdata-installer.sh

Si la instalación ha ido bien ,iniciamos netdata con

/usr/sbin/netdata

Ahora podemos abrir desde el navegador la url

http://localhost:19999

y comprobar las gráficas que nos muestra netdata.

Actualización:

Para actualizar netdata ejecutamos

cd /path/to/netdata.git
git pull
./netdata-installer.sh

To install netdata performance Monitoring tool on centos 7

Netdata is a tool to monitor system performance at real time. Installation of Netdata


performance monitoring tool is explained in this manual.

To install Netdata

Install the following dependency before installing Netdata.

[root@linuxhelp ~]# yum install zlib-devel gcc make git autoconf autogen
automake pkgconfig psmisc -y
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* base: centos.webwerks.com
* extras: centos.webwerks.com
* updates: centos.webwerks.com
Package 1:make-3.82-21.el7.x86_64 already installed and latest version
Package 1:pkgconfig-0.27.1-4.el7.x86_64 already installed and latest
version
.
.
.
Dependency Updated:
glibc.x86_64 0:2.17-106.el7_2.6 glibc-common.x86_64 0:2.17-
106.el7_2.6 libgcc.x86_64 0:4.8.5-4.el7 libgomp.x86_64 0:4.8.5-4.el7
zlib.x86_64 0:1.2.7-15.el7

Complete!

Clone the Netdata from git by using the following command.

[root@linuxhelp ~]# git clone https://github.com/firehol/netdata.git --


depth=1
Cloning into 'netdata'...
remote: Counting objects: 341, done.
remote: Compressing objects: 100% (302/302), done.
remote: Total 341 (delta 44), reused 151 (delta 25), pack-reused 0
Receiving objects: 100% (341/341), 1.72 MiB | 57.00 KiB/s, done.
Resolving deltas: 100% (44/44), done.

Navigate to netdata directory after cloning.

[root@linuxhelp ~]# cd netdata/


[root@linuxhelp netdata]# ls
autogen.sh charts.d configs.signatures COPYING m4
netdata.spec.in plugins.d README.md tests
build CMakeLists.txt configure.ac hooks Makefile.am
node.d profile src web
ChangeLog conf.d contrib LICENSE.md netdata-
installer.sh packaging python.d system

Execute “netdata-installer.sh” script to install netdata.

[root@linuxhelp netdata]# ./netdata-installer.sh

Sorry! NetData failed to build...

You many need to check these:

1. The package uuid-dev (or libuuid-devel) has to be installed.

If your system cannot find libuuid, although it is installed


run me with the option: --libs-are-really-here

2. The package zlib1g-dev (or zlib-devel) has to be installed.

If your system cannot find zlib, although it is installed


run me with the option: --libs-are-really-here

3. You need basic build tools installed, like:

gcc make autoconf automake pkg-config

Autoconf version 2.60 or higher is required.

If you still cannot get it to build, ask for help at github:

https://github.com/firehol/netdata/issues
If you get error like mentioned above we need to install one more package to resolve this
error. Run the below command to install the required package.

[root@linuxhelp netdata]# yum install libuuid-devel -y


Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos.webwerks.com
* extras: centos.webwerks.com
* updates: centos.webwerks.com
Resolving Dependencies
--> Running transaction check
---> Package libuuid-devel.x86_64 0:2.23.2-26.el7_2.2 will be installed
--> Processing Dependency: libuuid = 2.23.2-26.el7_2.2 for package:
libuuid-devel-2.23.2-26.el7_2.2.x86_64
--> Running transaction check
.
.
.
libgudev1.x86_64 0:219-19.el7_2.11 libmount.x86_64 0:2.23.2-
26.el7_2.2
libuuid.x86_64 0:2.23.2-26.el7_2.2 systemd.x86_64
0:219-19.el7_2.11 systemd-libs.x86_64 0:219-19.el7_2.11
systemd-python.x86_64 0:219-19.el7_2.11 systemd-sysv.x86_64
0:219-19.el7_2.11 util-linux.x86_64 0:2.23.2-26.el7_2.2

Complete!

Again execute the script file to install Netdata on your machine.

[root@linuxhelp netdata]# ./netdata-installer.sh

Welcome to netdata!
Nice to see you are giving it a try!

You are about to build and install netdata to your system.

It will be installed at these locations:

- the daemon at /usr/sbin/netdata


- config files at /etc/netdata
- web files at /usr/share/netdata
- plugins at /usr/libexec/netdata
- cache files at /var/cache/netdata
- db files at /var/lib/netdata
- log files at /var/log/netdata
- pid file at /var/run

This installer allows you to change the installation path.


Press Control-C and run the same command with --help for help.

Press ENTER to build and install netdata to your system >

:------------------------------------------------------------------------
-----
Running command:
./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
.
.
.
-------------------------------------------------------------------------
------

OK. NetData is installed and it is running (listening to *:19999).

-------------------------------------------------------------------------
------

INFO: Command line options changed. -pidfile, -nd and -ch are deprecated.
If you use custom startup scripts, please run netdata -h to see the
corresponding options and update your scripts.

Hit http://localhost:19999/ from your browser.

To stop netdata, just kill it, with:

killall netdata

To start it, just run it:

/usr/sbin/netdata

Enjoy!

Uninstall script generated: ./netdata-uninstaller.sh

Netdata is now successfully installed.


Allow the port in the firewall as follows.

[root@linuxhelp netdata]# firewall-cmd --permanent --add-port=19999/tcp


success
[root@linuxhelp netdata]# firewall-cmd --reload
success
Open the browser and navigate to http://IP-Address:19999

Overview of system performance


CPU Usage
Load for the system
Disk Usage
RAM Memory Usage
SWAP Memory Usage

You might also like