Many thanks for your help, now i have successfully created the fleet server and the agent is connected to it.
Both server and agent were green and healthy but after few minutes both turned yellow and unhealthy.
if i restart them they become healthy for few minutes and then turn to unhealthy.
In the minutes where both are healthy there are no logs coming.
I've checked the agent logs and found this
State changed to FAILED: 1 error occurred:\n\t* 1 error: open /usr/share/elasticsearch/elasticsearch-ca.crt: The system cannot find the path specified. reading <nil> accessing 'elasticsearch'\n\n - type: 'ERROR' - sub_type: 'FAILED'","ecs.version":"1.6.0"}
Checking fleet settings:
I can see the path is correct and i checked it from the elastic-stack I can confirm the file is there and accessible.
Your help is really appreciated.
Thanks in advance.