For the Telegraf agent to collect metrics for some of the application services, you must make modifications in the target machines. After you make these modifications, the agent starts collecting metrics. You must SSH to the virtual machine where you have deployed the agent and modify the configuration files.
Apache HTTPD
For the agent to collect metrics, modify the conf file available in /etc/httpd/conf.modules.d/status.conf and activate the mod_status for the HTTPD plugin.
<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 Application
Support for Java application monitoring is currently limited to applications that support jolokia based JMX monitoring. Currently, as part of Java plugin activation, both the jolokia.jar and jolokia.war files are placed in the "Installed Path". If the Java application to be monitored is a servlet container, then the jolokia.war file is automatically deployed to the "Installed Path" that you provided when you configured the Java application in VMware Aria Operations. If auto deployment is not supported or not activated, restart the application after activating the plugin or refer to the application's product documentation for the deployment of manual .war.
For all other java applications, first activate the plugin then include the path to the jolokia.jar file in the "-javaagent:" JVM flag as a command line parameter. For example, "-javaagent:/<path_to_jolokia>/jolokia.jar", <path_to_jolokia> is the "Installed Path" which was provided during application configuration. Restart the application.
- The jolokia based JMX monitoring is supported.
- In case auto deploy is turned off, manual .war deployment is supported for servlet container application.
- "-javaagent:" JVM flag is added as part of the command line parameter (JVM_OPTS)
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
Cassandra
To monitor the Cassandra database application, the Jolokia jar must be included as a JVM input to the Cassandra database application. Complete the following steps:
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
Note:You can download the latest version of the Jolokia agent from https://jolokia.org/download.html. 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.
Alternatively, you can activate 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
To monitor the Oracle database, complete these steps:
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.
- Install Python 3.6 or later. Install the cx_Oracle module.
python3 -m pip install cx_Oracle --upgrade
Create a User.
CREATE USER <UserName> IDENTIFIED BY <yourpassword>; GRANT select_catalog_role TO <UserName>; GRANT CREATE SESSION TO <UserName>;
- For a Windows VM:
- Append the Oracle instant client library path and the Python path to the PATH environment variable.
- Install the ARC agent.
- For a Linux VM:
- Install the ARC agent.
- Get the file exec_oracle_python.sh(wget --no-check-certificate https://<CP_IP>/downloads/salt/content-accessories/exec_oracle_python.sh) from /opt/vmware/ucp/.
- Fill in /opt/vmware/ucp/exec_oracle_python.sh with absolute values for LD_LIBRARY_PATH, ORACLE_HOME, PYTHON_BIN, and TNS_ADMIN.
LD_LIBRARY_PATH: Path to the Oracle instant client library. For example, /opt/vmware/ucp/instantclient_21_4.
ORACLE_HOME: Directory in the file system where the Oracle software is installed. For example, /u01/app/oracle/product/19.3.0/dbhome_1/.
PYTHON_BIN: Path to the Python executable. For example, /usr/bin/python.
TNS_ADMIN: Environment variable that points to the directory where the SQL*Net configuration files are located. For example, /u01/app/oracle/product/19.3.0/dbhome_1/network/admin.
- Activate the Oracle DB plugin.
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.
Microsoft SQL Server
The user account must have the following permissions to monitor the Microsoft SQL Server application service with Telegraf.
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