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
<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
http { server { location /status { stub_status on; access_log off; allow all; } } }
systemctl restart nginx
Postgres
local all postgres peer
to
local all postgres md5
and restart the service with the following command:
sudo service postgresql restart
Cassandra Database
- Modify /etc/default/cassandra.
echo "export JVM_EXTRA_OPTS=\"-javaagent:/usr/share/java/jolokia-jvm-1.6.0-agent.jar=port=8778,host=localhost\"" | sudo tee -a /etc/default/cassandra
- Alternatively, you can enable the agent by modifying cassandra-env.sh. Include the following line at the end of the cassandra-env.sh:
JVM_OPTS="$JVM_OPTS -javaagent:/usr/share/java/jolokia-jvm-1.6.0-agent.jar=port=8778,host=localhost"
After you see the JVM inputs, restart the Cassandra service.
Oracle Database
- Download the instant client library from: https://www.oracle.com/database/technologies/instant-client/downloads.html.
You must download the Oracle instant library and included it in the PATH.
- Create a User.
CREATE USER <UserName> IDENTIFIED BY <yourpassword>; GRANT select_catalog_role TO <UserName>; GRANT CREATE SESSION TO <UserName>;
- Install Python 3.6 or later.
python3 -m pip install cx_Oracle --upgrade
- Set the PATH of TNS_ADMIN.
For example, the path for TNS_ADMIN will be similar to c:\app\product\<version>\dbhome_1\NETWORK\ADMIN”.
Active MQ 5.16 and Later Versions
To activate Active MQ 5.16 and later versions, complete the following steps:
- Navigate to /opt/activemq/apache-activemq-5.16.0/webapps/api/WEB-INF/classes/jolokia-access.xml
- Remove or comment out the following lines:
<cors> <strict-checking/> </cors>
- Restart the Active MQ service.
MS SQL
USE master; GO CREATE LOGIN [telegraf] WITH PASSWORD = N'mystrongpassword'; GO GRANT VIEW SERVER STATE TO [telegraf]; GO GRANT VIEW ANY DEFINITION TO [telegraf]; GO