0
  • nginx版本:nginx/1.12.1
  • 动态跟踪版本:7.0
  • uname -a ==> Linux xxx.elinux.xxx 3.10.0-693.2.2.el7.x86_64 #1 SMP Sat Sep 9 03:55:24 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

我一直在尝试将 nginx 指标发送到 Dynatrace,但没有成功。

当我启动 nginx 时,dynatrace 代理日志显示 -

2017-10-31 21:58:14 [ce68772b] info    [native] Successfully loaded agent binary /opt/dynatrace/agent/downloads/appmon/native/7.0.8.1014/linux-x86-64/libdtnginxagent.so

==> dt_dtnginxagent_w1b-dev-et-rz-app-bb-web_26779.0.log <==
2017-10-31 21:58:19.808088 [26779/ce68772b] warning [native] generate_offsets.sh script generated
2017-10-31 21:58:19.808181 [26779/ce68772b] warning [native] Automatic Nginx agent configuration generation failed
2017-10-31 21:58:19.808192 [26779/ce68772b] warning [native] In order to run Nginx with dynaTrace Agent you need to perform this manual step:
2017-10-31 21:58:19.808199 [26779/ce68772b] warning [native] Please run the following command to generate Nginx Agent configuration and then restart Nginx:
2017-10-31 21:58:19.808208 [26779/ce68772b] warning [native] /opt/dynatrace/agent/conf/generate_offsets.sh -b /usr/sbin/nginx -o /opt/dynatrace/agent/conf/dtnginx_self_generated_offsets.json

2017-10-31 22:23:39.474132 [26751/b77f98d5] info    [native] New subAgent registered successfully: db846b2b
2017-10-31 22:23:39.485625 [26751/b77f98d5] info    [native] sub agent registered with id (sub/slave) db846b2b/dedfe76e9 (UDP queue size: 0)
2017-10-31 22:23:45.090885 [26751/b77f98d5] info    [native] New subAgent registered successfully: b805cd43
2017-10-31 22:23:45.090913 [26751/b77f98d5] info    [native] sub agent registered with id (sub/slave) b805cd43/d8ec7151e (UDP queue size: 0)
2017-10-31 22:23:52.102050 [26751/c69d78d5] info    [native] License update received for sub agent db846b2b: license = ok, uem volume = not exhausted
2017-10-31 22:23:52.102104 [26751/c69d78d5] info    [native] Subagent license is updated, id=[0xdb846b2b] = license ok;

2017-10-31 22:23:52.114657 [26751/c69d78d5] info    [native] License update received for sub agent b805cd43: license = ok, uem volume = not exhausted
2017-10-31 22:23:52.114689 [26751/c69d78d5] info    [native] Subagent license is updated, id=[0xb805cd43] = license ok;

2017-10-31 22:23:59.099111 [26751/c8c0f895] info    [native] Unregistering subAgent db846b2b
2017-10-31 22:23:59.099191 [26751/c8c0f895] info    [native] sub agent unregistered with id (sub/slave) db846b2b/dedfe76e9 (UDP queue size: 0)
2017-10-31 22:24:05.106795 [26751/c8c0f895] info    [native] Unregistering subAgent b805cd43
2017-10-31 22:24:05.106863 [26751/c8c0f895] info    [native] sub agent unregistered with id (sub/slave) b805cd43/d8ec7151e (UDP queue size: 0)

根据文档,我已将“/usr/lib/systemd/system/nginx.service”文件更新如下 -

[Unit]
Description=nginx - high performance web server
Documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
Environment=LD_PRELOAD=/opt/dynatrace/agent/lib64/libdtagent.so
ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf -p /opt/log/nginx
ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf -p /opt/log/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=multi-user.target

我错过了什么?

4

0 回答 0