1. 개요
Datadog을 통한 Apache HTTP Server 모니터링
2. 설정
2-1. Datadog 에이전트 설치
2-2. mod_status 설정
2-3. Metric Collection
/etc/datadog-agent/conf.d/apache.d/conf.yaml 생성
init_config: instances: - apache_status_url: http://127.0.0.1/server-status?auto # apache_user: example_user # if apache_status_url needs HTTP basic auth # apache_password: example_password # disable_ssl_validation: true # if you need to disable SSL cert validation, i.e. for self-signed certs
2-4. Log Collection
/etc/datadog-agent/conf.d/apache.d/conf.yaml 파일에 추가
logs: - type: file path: /var/log/access_log_* source: apache sourcecategory: http_web_access service: apache - type: file path: /var/log/apache2/error_log_* source: apache sourcecategory: http_web_access service: apache
2-5. Datadog 에이전트 재시작
$ sudo service datadog-agent restart
3. Datadog Agent 삭제
# apt-get --purge remove datadog-agent -y Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: linux-aws-headers-4.4.0-1066 linux-aws-headers-4.4.0-1069 linux-aws-headers-4.4.0-1070 linux-headers-4.4.0-1066-aws linux-headers-4.4.0-1069-aws linux-headers-4.4.0-1070-aws linux-image-4.4.0-1066-aws linux-image-4.4.0-1069-aws linux-image-4.4.0-1070-aws Use 'apt autoremove' to remove them. The following packages will be REMOVED: datadog-agent* 0 upgraded, 0 newly installed, 1 to remove and 76 not upgraded. After this operation, 359 MB disk space will be freed. (Reading database ... 217517 files and directories currently installed.) Removing datadog-agent (1:6.6.0-1) ... Removed symlink /etc/systemd/system/multi-user.target.wants/datadog-agent-process.service. Removed symlink /etc/systemd/system/multi-user.target.wants/datadog-agent-trace.service. Removed symlink /etc/systemd/system/multi-user.target.wants/datadog-agent.service. find: ‘/opt/datadog-agent/agent’: No such file or directory Unable to delete .pyc files in /opt/datadog-agent/agent Purging configuration files for datadog-agent (1:6.6.0-1) ... Deleting dd-agent user Deleting dd-agent group Force-deleting /opt/datadog-agent dpkg: warning: while removing datadog-agent, directory '/opt' not empty so not removed Processing triggers for systemd (229-4ubuntu21.15) ... Processing triggers for ureadahead (0.100.0-19) ...