Web Server agent
Prerequisites
- Docker should be installed (Steps to install docker - https://docs.docker.com/get-docker/)
- URL of the SixthSense collector which will be provided by Customer Support.
- Access token from the SixthSense portal. For accessing the token, see Accessing your Access Token.
- docker registry credentials which will be provided by Customer Support.
- Enable Nginx status module You can skip this step if ngx_http_stub_status_module or ngx_http_api_module is already enabled.
Nginx open source
- For monitoring Nginx open source edition ngx_http_stub_status_module should be enabled. See, https://nginx.org/en/docs/http/ngx_http_stub_status_module.html
- Once ngx_http_stub_status_module module is enabled add the below configuration in the nginx.conf file.
location /status {
stub_status;
allow 127.0.0.1;
deny all;
}
Nginx Plus
- For monitoring Nginx plus edition ngx_http_api_module should be enabled. See http://nginx.org/en/docs/http/ngx_http_api_module.html.
- Once ngx_http_api_module module is enabled add the below configuration in nginx.conf.
location /status {
api;
allow 127.0.0.1;
deny all;
}
- Download Nginx agent Docker image.
docker login gitlab-registry.34.120.183.186.sslip.io
# username and password will be provided by onboarding team
docker pull gitlab-registry.34.120.183.186.sslip.io/sixthsense/sixthsense-mvn-dependency/nginx-agent:v2
- Configure the Nginx agent.
Create a .env file containing below properties
Note: For connecting the agent to Onecloud collector, SSL should be set to false, i.e. SSL=false.
SERVICE_NAME=<name of the service>
SS_HOST=<host name of the sixthsense collector>
NGINX_STATUS_URL=<Nginx status URL eg. http://host.docker.internal/status>
AUTHENTICATION=<authentication token from dashboard>
SSL=<boolean, flag if ssl is required>
FETCH_INTERVAL=* * * * * *DEBUG=ss-agent:<level> (level supported: debug, info, warn, error)
Example: Agent Configuration
SERVICE_NAME=nginx_QA_Prod
SS_HOST=grpc-collector-observability.sixthsense.rakuten.com:443
NGINX_STATUS_URL=http://host.docker.internal/status/
AUTHENTICATION=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZWFtSWQiOiJmOTJmMjFhMC0xNDQ2LTRlNjItOTM4ZS1lZWFhN2UwZTc4NDkiLCJiaWxsaW5nX2lkIjoiMzVhNzBlZDUtZjZmMS00ZGViLTg2YmItYjdhYWFiMmQ1ZDQ3IiwiaWF0IjoxNjQ0MjMwODk2LCJhdWQiOiJvYXAiLCJpc3MiOiJzaXh0aC1zZW5zLWF1dGgifQ.O133bsGRnNMuetwcnFm05hpw9uGbzCTPDP5KJhtA7ok
SSL=true
FETCH_INTERVAL=* * * * * *
DEBUG=ss-agent:info
- Start the Nginx agent.
Run the agent using the following command.
docker run --env-file ./.env -d --restart always gitlab-registry.34.120.183.186.sslip.io/sixthsense/sixthsense-mvn-dependency/nginx-agent:v2
References: