datadog-agent: security-agent.yaml not found during one-step install
I want to install datadog agent on Debian 11 (bullseye). Therefor I use the one-step install script from the docs in the datdog-hq website: bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"
When installing the agent v7 on ubuntu using the one-step script, I get an error during installation saying the /etc/datadog-agent/security-agent.yaml file is missing. There is a security-agent.yaml.example file, but it doesn’t get copied.
When using the DD_INSTALL_ONLY=true flag, the installation runs through smoothly. When I start the agent afterwards, I get the same error, but the agent runs because I can see continously added common metric checks in the datadog logs appearing.
I can not find anything useful about the security-agent.yaml file, so are you already aware of this?
Can I just copy over the example file as is? At least it seems to work.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 24
- Comments: 17 (6 by maintainers)
Hi, just to confirm, setting
DD_HOSTNAME=defaultworks right?I am installing the datadog agent inside a docker image
Hi,
Thanks for raising these issues!
This is the normal behavior of the script:
datadog-agentpackage,datadog-agentpackage, as part of its post-install hooks, checks ifdatadog.yamlalready exists; if it does, it starts the Agent, otherwise it logs theNo datadog.yaml file detected, not starting the agentmessage (which doesn’t make the install fail, it’s only here for informative purposes). Here, we are in the second case,/etc/datadog-agentconfiguration file (by copying the example file provided by the package, and filling the file with info passed on the command line such asDD_API_KEY), and starts the Agent (and logs the* Starting the Datadog Agent...line when it does).We could improve this by stressing the fact that this log line is not an error (eg. by adding an
[INFO]tag before that log line).My guess here is that you are seeing a message like
/etc/datadog-agent/security-agent.yaml not found. Exiting datadog-agent-securityin the output of the installation script. Could you confirm that this is what you are seeing?The security-agent is an optional component of the Agent, that is enabled by creating the
security-agent.yamlconfiguration file. The install script doesn’t enable that component (it only provides thesecurity-agent.yaml.exampleexample file in case you would like to enable this feature).When the
datadog-agentservice starts, it tries to start all optional services of the Agent, including thedatadog-agent-securityservice which handles the security-agent component. Thedatadog-agent-securityservice only starts if thesecurity-agent.yamlfile is found.That is why you are seeing the
/etc/datadog-agent/security-agent.yaml not foundlog message. That is also why you don’t get that message withDD_INSTALL_ONLY=true, as this disables the part of the script which starts thedatadog-agentservice.If you want to enable the security-agent components, you have to create the
security-agent.yamlfile after running the install script; if you don’t, nothing needs to be done.I have the same issue, but I’m not entirely sure the problem is linked to that last line of log before the error. I also have a log above saying
No datadog.yaml file detected, not starting the agent, which is a bit worrying. Especially since it’s followed a couple of line later with* Starting the Datadog Agent....Thanks, that confirms my initial feeling. As mentioned above, the
security-agentmessage is just an info-level message, and isn’t the actual cause of the crash.The real error is the
Error while getting hostname, exiting: unable to reliably determine the host name. You can define one in the agent config file or in your hosts fileline, which indicates you are encountering this issue: https://github.com/DataDog/datadog-agent/issues/14152. I suggest reading the advice here: https://github.com/DataDog/datadog-agent/issues/14152#issuecomment-1408471209.In this specific case, you may be able to work around this by specifying
DD_HOSTNAME=<your host name>in the parameters of the install script.