Original Grade: 10 Installing the NS1 Agent In this section we install and configure the NS1 agent on the same hosts as our NGINX Plus instances. We also create an NS1 data feed for each agent, which enables it to send status information about its paired NGINX Plus instance to NS1 via the NS1 API. Follow the instructions in the NS1 documentation to set up and connect a separate data feed for each of the three NGINX Plus instances, which NS1 calls answers. On the first page (Configure a new data source from NSONE Data Feed API v1) specify a name for the data source, which is the administrative container for the data feeds you will be creating. Use the same name each of the three times you go through the instructions. We’re naming the data source NGINX-GSLB. On the next page (Create Feed from NSONE Data Feed API v1), create a data feed for the instance. Because the Name field is just for internal use, any value is fine. The value in the Label field is used in the YAML configuration file for the instance (see Step 4 below). We’re specifying labels that indicate the country (using the ISO 3166 codes) in which the instance is running: us-nginxgslb-datafeed for instance 1 in the US de-nginxgslb-datafeed for instance 2 in Germany sg-nginxgslb-datafeed for instance 3 in Singapore After creating the three feeds, note the value in the Feeds URL field on the  INTEGRATIONS  tab. The final element of the URL is the you will specify in the YAML configuration file in Step 4. In the third screenshot in the NS1 documentation, for example, it is e566332c5d22c6b66aeaa8837eae90ac. Follow the instructions in the NS1 documentation to create an NS1 API key for the agent, if you have not already. (To access Account Settings in Step 1, click your username in the upper right corner of the NS1 title bar.) We’re naming the app NGINX-GSLB. Make note of the key value – you’ll specify it as in the YAML configuration file in Step 4. To see the actual hexadecimal value, click on the circled letter i in the API Key field. On each NGINX Plus host, clone the GitHub repo for the NS1 agent. On each NGINX Plus host, create the YAML configuration file for the NS1 agent. In this guide we’re using the following file: Copy agent: interval: 10 retry_time: 5 nginx_plus: hosts: - host: "127.0.0.1:8000" resolve: false host_header: "127.0.0.1:8000" api_endpoint: "/api" client_timeout: 10 nsone: api_key: "" client_timeout: 10 source_id: "" services: method: "upstream_groups" threshold: 2 sampling_type: "count" feeds: - name: "my_backend" feed_name: "-nginxgslb-datafeed" The hosts section configures the agent to run on the same host as the NGINX Plus instance from which it collects metrics – in this guide, localhost. Because localhost is identified by its IP address (127.0.0.1) in the host field, hostname resolution is unnecessary and resolve is set to false. The agent gathers metrics from the NGINX Plus API (the /api endpoint) on port 8000. In the nsone section, include the and values you noted in Step 2 and Step 1, respectively. In the services section, we’re specifying upstream_groups as the method for the NS1 agent to use, meaning that it collects metrics about the upstream group that the NGINX Plus instance is load balancing – my_backend, as specified in the name field of the feeds section. The threshold field defines how many servers in the upstream group must be healthy for the backend app to be considered up, and the sampling_type field tells the agent to collect the sum of active connections to backend servers. (We’re leaving actual setup of the backend app and the configuration file for the NGINX Plus instance as exercises for the reader.) The agent configuration is the same for each of the paired agents and NGINX Plus instances, except for the value in the feed_name field (see Step 1 for the feed names). If you choose to configure a different upstream group for each instance, also change the value in the name field. For details about all fields in the configuration file, see the documentation in our GitHub repo. Follow the instructions in the GitHub repo to start the agent.