this new cloud looks very interesting and i already tested my first node, i used the docker agent,
but - i am not surprised - the hostname is NOT the host itself, the hostname of the docker container is used…
i also tried the param “-host” as explained here: Connect Agent to Cloud | Learn Netdata
but still i only see the docker-containers-hostname. how can i change that ?
As an alternative to the Docker hostname thing mentioned by Zack, you can manually override the hostname that Netdata reports in the netdata.conf file by adding a hostname key under the [global] section. This obviously doesn’t scale well if you have a lot of nodes, but if you’ve only got one or two it can be a much easier solution than trying to get Docker to give all the containers sane hostnames.
You may have to create networks and assign hostnames for containers within those networks using docker network create and following up with docker run -h human_readable_hostname --ip [an ip on the network] --net [the network created]. These commands will have some additional options based on what exactly you are trying to run…
It might be easier to use docker-compose for something like that. In any case I think the trick is to set a readable hostname for the container.
We also have a lengthy docker guide but I don’t think it covers this specific question.
I am running netdata deployed in a docker swarm using global mode across 10+ nodes, hence settings hostname on individual nodes is cumbersome.
I have used the docker swarm compose provided by netdata.
The documentation states that:
Alternatively, you can directly use the hostname from the node running the container by mounting /etc/hostname from the host in the container. With docker run , this can be done by adding --volume /etc/hostname:/etc/hostname:ro to the options. If you are using Docker Compose, you can add an entry to the container’s volumes section reading - /etc/hostname:/etc/hostname:ro .
This is default in the provided swarm deployment compose, however, it does not reflect on the nodes when they show up, they have the docker container name as hostname.
Maybe i misunderstood something, but it seems like the steps described in the documentation does not work, which means the provided docker-compose for swarm for adding nodes, does not work as inteded also.