For telegraf agent to collect metrics for some of the application services, you must make modifications in the endpoint VMs. After you make these modifications, the agent will start collecting metrics. You must SSH to the virtual machine where you have deployed the agent and modify the configuration files.

Apache HTTPD

Modify the conf file available in /etc/httpd/conf.modules.d/status.conf and enable the mod_status for the HTTPD plugin for the agent to collect metrics.
<IfModule mod_status.c>

<Location /server-status>

    SetHandler server-status

</Location>

ExtendedStatus On

</IfModule>
If the conf file is not available, you must create one. Restart the HTTPD service after modifying the conf file with the following command:
systemctl restart httpd

Java Plugins

To monitor Java applications, you can deploy the Jolokia plugin as a .WAR file or .JAR file. If you are deploying a .WAR file, you do not have to restart the services.

For a .JAR file deployment, you have to restart the application service after including the full file path of the JAR in the JMX argument of the JAVA process which you are monitoring.

Nginx

Add the following lines to the conf file available in /etc/nginx/nginx.conf:
http {
    server {
        location /status {
            stub_status on;
   access_log off;
   allow all;
  }
    }
}
Restart the Nginx service with the following command:
systemctl restart nginx

Postgres

In the configuration file available in the /var/lib/pgsql/data/pg_hba.conf, change the value of local all postgres peer to local all postgres md5 and restart the service with the following command:
sudo service postgresql restart