8.9.4. Using a Netdata server

8.9.4.1. Introduction

This procedure gives as an indication the steps necessary to set up a Netdata monitoring server, and its interconnection to a GCenter to ensure monitoring.

Note

The Netdata version compatible with GCenter and GCap is 1.19


8.9.4.2. Prerequisites

  • User : member of Administrator group


8.9.4.3. Procedure to install via docker

  • Install the Netdata docker.

    docker pull netdata/netdata:v1.19.0
    
  • To be able to edit the Netdata configuration from the host machine, a temporary container must be launched to retrieve the configuration files.

    mkdir netdataconfig
    docker run -d --name netdata_tmp netdata/netdata
    docker cp netdata_tmp:/usr/lib/netdata netdataconfig/
    docker rm -f netdata_tmp
    
  • Launch the final container.

    docker run -d --name=netdata \
     -p 19999:19999 \
     -v $(pwd)/netdataconfig/netdata:/usr/lib/netdata:rw \
     -v netdatalib:/var/lib/netdata \
     -v netdatacache:/var/cache/netdata \
     -v /etc/passwd:/host/etc/passwd:ro \
     -v /etc/group:/host/etc/group:ro \
     -v /proc:/host/proc:ro \
     -v /sys:/host/sys:ro \
     -v /etc/os-release:/host/etc/os-release:ro \
     --restart unless-stopped \
     --cap-add SYS_PTRACE \
     --security-opt apparmor=unconfined \
     netdata/netdata
    

8.9.4.4. Procedure to configure the stream.conf file and GCenter

  • Generate the uuid.

sudo docker exec -it netdata uuidgen
  • Configure stream with the uuid generated previously.

Netdata recommends using edit-config

sudo docker exec -it netdata /etc/netdata/edit-config stream.conf
[dd236090-a42d-43e2-b0ba-ff8eaa6216a2] << Remplacer l'uuid ici
    enabled = yes
    default history = 36000
    default memory mode = ram
    health enabled by default = auto
    allow from = *
    default postpone alarms on connect seconds = 60

8.9.4.5. Procedure to configure the netdata.conf file

sudo docker exec -it netdata /etc/netdata/edit-config netdata.conf
[global]
       ...
       hostname = netdata-docker.gatewatcher.com
       ...
       timezone = Europe/Paris

8.9.4.6. Procedure to configure the Netdata export in the GCenter

  • For Netdata to send notifications, the health_alarm_notify.conf` file must be configured.

sudo docker exec -it netdata /etc/netdata/edit-config health_alarm_notify.conf

Reference : Alarm Configuration


8.9.4.7. Procédure to create alerts for Netdata

  • Create alerts in the container folder.

/usr/lib/netdata/conf.d/health.d
  • In order for the new alerts to be taken into account, it is necessary to restart the docker container.

  • To clarify the management of your alerts, it is advisable to create a *. conf` file by alert category.
    Examples include:

    Description

    Link

    Alert in case of absence/traffic overload

    traffic.conf

    Alert in case of deactivation of GCap analysis services

    suricata_status.conf

    Alert if a restart of GCap/GCenter has occurred

    reboot.conf

    RAM overload alert

    ram.conf

    Alert in case of "dropped" network packets on the Gcap

    drop.conf

    Alert in case of disk filling (here the/data partition of the GCap)

    disk.conf

    CPU overload alert

    cpu.conf

  • Create your own alerts.
    The creation of alerts is based on the metrics that netdata collects.
    • To know these metrics, you must connect to the Netdata interface of your GCenter.

    https:// IP ou FQDN du Gcenter /gstats
    

    Take the example of RAM monitoring.

    ../../_images/netdata_RAM.png

    The Graph name is system.ram` and the curve to watch is used.

    • The alert in the ram.conf` file will be written as follows:
    • The alarm is called
      1>>  alarm: ram_usage
      
    • The chart is named in Netdata:

    2>> on: system.ram
    
    • Indicates that the 10 min average of the used curve

    3>> lookup: average -10m percentage of used
    
    • The unit is specified

    4>> units: %
    
    • The time interval between each calculation is specified

    5>> every: 1m
    
    • Alert and critical thresholds are defined

    6>> warn: $this > 70
    7>> crit: $this > 90
    
    • Set time to clear alarm after tripping

    8>> delay: down 15m multiplier 1.5 max 1h
    
    • Description de l'alarme

    9>> info: average RAM utilization over the last 10 minutes
    
    • Define who will be alerted (see health_alarm_notify.conf)

    10>> to: sysadmin