ipr-cnrs.netdata
Netdata
Overview
This is a guide to install and configure Netdata.
Role Variables
- netdata__base_packages: The basic packages needed for Netdata [default:
netdata
]. - netdata__install_recommends: Whether to install recommended packages [default:
True
]. - netdata__deploy_state: The target state for this role [default:
present
]. - netdata__group_name: Name of the directory for specific group configurations [default:
nonexistent-host-group
]. - netdata__default_etc_src: Directory for Netdata configuration files from this role [default:
../templates/etc/netdata
]. - netdata__etc_src: Directory for configuration files managed on all hosts [default:
../templates/etc/netdata
]. - netdata__group_etc_src: Directory for group-specific configuration files [default:
{{ (inventory_dir | realpath + "/../resources/") + "files/by-group/" + netdata__group_name + "/etc/netdata" }}
]. - netdata__host_etc_src: Directory for host-specific configuration files [default:
{{ (inventory_dir | realpath + "/../resources/") + "files/by-host/" + inventory_hostname + "/etc/netdata" }}
]. - netdata__service_name: The name of the service to manage [default:
netdata
]. - netdata__service_manage: Whether to manage the Netdata service [default:
True
]. - netdata__conf_bind_ip: IP address Netdata listens on [default:
127.0.0.1
]. - netdata__conf_bind_port: Port number Netdata listens on [default:
19999
]. - netdata__conf_memory_mode: The memory mode for the database [default:
ram
]. - netdata__conf_recipient_email: Default email recipient if none is provided [default:
root
]. - netdata__registry_enable: Whether this node should act as a registry [default:
False
]. - netdata__registry_announce: The URL for the registry [default:
''
]. - netdata__registry_hostname: The name displayed on the registry (max 50 characters) [default:
{{ ansible_hostname }}
]. - netdata__slave_enable: Whether this node should send data to a master node [default:
False
]. - netdata__slave_destination: The address to send data to [default:
netdata.{{ ansible_domain }}
]. - netdata__slave_api_key: API key for identifying with the master [default:
''
]. - netdata__slave_buffer_size: Buffer size for sending data [default: ``].
- netdata__slave_reconnect: Number of seconds to wait before retrying a failed connection [default:
5
]. - netdata__master_enable: Whether this node should receive data from other nodes [default:
False
]. - netdata__master_api_key: API key for authenticating slave nodes [default:
''
]. - netdata__master_history: The number of entries to keep in the database per host [default:
3600
]. - netdata__master_memory_mode: Memory mode for all hosts using this API key [default:
ram
]. - netdata__master_health_alarm: Whether to send alarms for hosts using this API key [default:
auto
].
Example Playbook
- Using default variables:
- hosts: mynode.DOMAIN
roles:
- role: ipr-cnrs.netdata
tags: ['role::netdata', 'ipr']
- Using your own Netdata configuration:
- Make sure you have a resources directory that only contains templates or sub-directories, like this:
inventory
├── group_vars
│ ├── all
│ │ ├── ….yml
│ │ └── netdata.yml
│ └── …
resources
├── files
│ ├── by-group
│ │ └── all
│ │ ├── etc
│ │ │ ├── netdata
│ │ │ │ ├── health.d
│ │ │ │ │ └── ram.conf.j2
│ │ │ │ ├── plugins.d
│ │ │ │ │ └── python.d.plugin
│ │ │ │ └── python.d
│ │ │ │ └── fail2ban.chart.py
- To listen on LAN (but be careful, Netdata is not meant to be exposed openly):
- hosts: mynode.DOMAIN
roles:
- role: ipr-cnrs.netdata
netdata__etc_src: '{{ inventory_dir + "/../resources/host/mynode.DOMAIN/etc/netdata/" }}'
- Limit access to port 19999 to trusted IP addresses using your firewall [check the security documentation][netdata wiki security].
Configuration
This role will:
- Install necessary packages for the
netdata
service. - Manage the Netdata configuration directory (/etc/netdata) from various sources (netdata__default_etc_src, netdata__etc_src, netdata__group_etc_src, and netdata__host_etc_src).
- Ensure the Netdata service is enabled and running.
- Set basic configurations (IP, port, etc.).
- Configure registry settings (see [documentation][netdata wiki registry]).
- Can set up a slave/master configuration, but it's best to review registry information first.
Development
The source code is from our [Gogs instance][netdata source], and the [Github repo][netdata github] is available just for sharing the role on Ansible Galaxy.
Feel free to report issues or contribute with PRs here :)
Thanks to this [hook][gogs to github hook], GitHub gets automatic updates from our [Gogs instance][netdata source].
License
[WTFPL][wtfpl website]
Author Information
Jérémy Gardais
- Source: [on IPR's Gogs][netdata source]
- [IPR][ipr website] (Institut de Physique de Rennes)
Installa
ansible-galaxy install ipr-cnrs.netdata
Licenza
Unknown
Download
71
Proprietario
Institut de Physique de Rennes
https://ipr.univ-rennes1.fr/
Tutelles CNRS et Université Rennes 1