Host Registration
Introduction
Manually creating new hosts can be quite tedious in larger setups. Host registration offers the option of automatically registering new hosts in the WebGUI and adding the host directly to the desired groups and templates. In this way, hosts can be registered in the WebGUI using automation tools such as Ansible, Salstack, Puppet or Chef.
Setup in the WebGUI
To set up a new automatic registration configuration, click through the menus as shown in the following graphic:
After you have filled out and submitted the form, the configuration options expand, allowing you to specify which groups and templates a host should be automatically added to when the host registers.
Once the setup is complete, you can now add new hosts with a simple cURL request. The data is transferred to the WebGUI in JSON format using the POST method. Example:
curl https://your-webgui.example/register -H 'Content-Type: application/json' -d '{
"authkey": "your-very-long-secret-authkey",
"hostname": "test.example",
"ipaddr1": "127.0.0.1"
}'
Once setup is complete, you will receive the host’s ID and password. The password is automatically generated and is a 64-character string.
{
"status": "ok",
"data": {
"host_id": 12345,
"password": "secret"
}
}
The following parameters with data type are allowed:
Parameter | Datatype | Meaning |
---|---|---|
authkey | String | The authentification key |
hostname | String | The name of the hosts |
description | String | A small description of the host |
ipaddr1 | String | The 1. IP address |
ipaddr2 | String | The 2. IP address |
ipaddr3 | String | The 3. IP address |
ipaddr4 | String | The 4. IP address |
sysinfo | String | A free text field for a detailed description |
country_code | String | The country code for the host’s location |
location_class | String | Location of the host in PATH format |
project_class | String | Project description in PATH format |
tags | List [ ] | A list of TAGS of the templates to which the host should be added |
variables | Dict { } | Host variables to override template variables |
allow_from | List [ ] | A list of IPs and networks from which Bloonix agents are allowed to access the Bloonix server |
Here is an example with all allowed parameters:
{
"authkey": "your-very-long-secret-authkey",
"hostname": "test.example",
"ipaddr1": "127.0.0.1",
"ipaddr2": "127.0.0.2",
"ipaddr2": "127.0.0.3",
"ipaddr2": "127.0.0.4",
"sysinfo": "My first Host registered",
"country_code": "DE",
"location_class": "/DC1/Rack100",
"project_class": "/Bloonix/Project1/Loadbalancer",
"tags": [
"linux",
"postgresql",
"redis",
"nginx",
"port80",
"port443"
],
"variables": {
"ifname.public": "eth0",
"ifname.private": "eth1"
},
"allow_from": [
"127.0.0.0/8",
"::1"
],
}
Activation of registered hosts
Once a host has been registered, it can be activated.
Before activation, you also have the opportunity to check the host and make a few adjustments.