Prerequisite Details for Database Monitoring
Matrix of Metrics per Monitoring Type
Introduction:
Entuity supports management of the following on-prem database types:
- Azure SQL
- MariaDB 10.3 upwards
- Microsoft SQL 2025, 2022, and 2019
- MongoDB 6.3 upwards
- MySQL 8.0 upwards
- Oracle Database 23, 21, and 19
- PostgreSQL 16 upwards
- SAP HANA 2.0 SPS 04 upwards
Some of the database types have specific requirements for being able to poll performance metrics. Prerequisite instructions for each database type follow, along with a section that contains a matrix of the metrics provided by each monitoring type.
Prerequisite Details for Database Monitoring:
Azure SQL
To monitor the database, configure a user so that the database can connect to and from an external host with privileges, allowing the user to query performance metrics.
- Connect to the master database on the Azure SQL instance.
-
Run the following commands, supplying the username and password to create a new user with privileges for monitoring.
CREATE LOGIN username WITH PASSWORD = 'password'; CREATE USER username FOR LOGIN username; ALTER SERVER ROLE ##MS_DefinitionReader## ADD MEMBER username; ALTER SERVER ROLE ##MS_ServerStateReader## ADD MEMBER username;
-
To optionally monitor database jobs, connect to the database containing the Elastic Jobs catalog, and run the following commands.
CREATE USER username FOR LOGIN username; GRANT SELECT ON SCHEMA::jobs TO username;
MySQL/MariaDB:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query performance metrics.
- Navigate to the directory containing the mysql.exe executable.
Themysql.exeexecutable is located in the entuity_home/database/bindirectory on Entuity servers. -
Run the following command to connect to the database through the command-line utility.
./mysql -u [username|root] -P 3306 -h 127.0.0.1 -
At the command line, run the following commands as a root user.
This creates a new user account, allowing connections from an external host, and grant additional privileges to the user..CREATE USER username@'%' IDENTIFIED BY 'password'; GRANT SELECT, PROCESS ON * . * TO username@'%'; GRANT SELECT, EXECUTE ON sys.* TO username@'%'; GRANT SELECT ON sys.schema_table_statistics_with_buffer TO username@'%'; -
Run the following command to add the changes you just made.
FLUSH PRIVILEGES;
To Enable the Performance Schema on a Database:
By default, the performance schema is enabled on most MySQL and MariaDB databases, but this can be disabled, which is done on the Entuity MariaDB database. Database monitoring will work without the performance schema enabled; however, certain performance metrics cannot be polled without it. Follow the steps below to enable the performance schema.
-
Navigate to the directory containing the
my.cnfconfiguration file, and edit the file, as shown in the following example.
Note, for Entuity servers, the file is namedmy_eye.cnfand is located in the entuity_home/install/template/etcdirectory.performance_schema=1 - Restart the database for the changes to take effect.
Note, for Entuity servers, you must runconfigurefor the changes to take effect.. - If the performance metrics are still not all being gathered, you might need to run ‘mysql-upgrade.exe’ on the database.
Themysql-upgrade.exefile is located within the entuity_home/database/bin directory on Entuity servers.
Microsoft SQL:
To monitor the database, configure a user so that the database can connect to and from an external host with privileges, allowing the user to query performance metrics.
- Connect to the Microsoft SQL server using SQL Server Management Studio (SSMS).
- In Object Explorer, right-click the MS SQL server instance that you want to monitor, and then select properties.
- Open the Security tab, set "Server authentication" to "SQL Server and Windows Authentication mode", and then click OK to save.
- Open the Connections tab, ensure "Allow remote connections to this server" is enabled, and then click OK to close the window.
- In the Object Explorer pane, expand the Security folder, and then right-click the Logins folder.
- Select the New Login... option, and then click SQL authentication.
- Provide a username in the Login name field, create a password, and reenter the password in the Confirm password field.
- Clear the User must change password at next login checkbox, select master as the Default database, and select English from the default language drop-down menu, if it differs from the default.
- Navigate to the Server Roles tab, and select the following:
- ##MS_DatabaseConnector##
- ##MS_DefinitionReader##
- ##MS_PerformanceDefinitionReader##
- ##MS_ServerPerformanceStateReader##
- ##MS_ServerSecurityStateReader##
- ##MS_ServerStateReader##
- public
- Navigate to the User Mapping tab, select msdb, and select the following options under Database role membership:
- SQLAgentReaderRole
- db_datareader
- Click OK to save.
- Open SQL Server Configuration Manager, expand the SQL Server Network Configuration folder on the left, and select the Protocols for MSSQLSERVER option.
- Right-click TCP/IP, and select properties.
- Ensure Enabled is set to Yes on the Protocol tab, and the IP Addresses tab displays the correct TCP port (the default is 1433).
- Open Windows Defender Firewall, and create an inbound rule to allow TCP traffic on the TCP port that was listed in the TCP/IP properties of SQL Server Configuration Manager.
- Complete the configuration by restarting the MS SQL Server service for the changes to take effect.
To configure Kerberos authentication:
Kerberos authentication can optionally be used for the monitoring of Microsoft SQL Server Databases. Kerberos authentication configuration settings in Entuity applies to both database monitoring and WinRM connections which requires configuration edits on the Entuity server.
The host and Entuity server must be able to resolve the domain controller. To test and verify this, use the following command:
nltest /dsgetdc: <Domain>
-
On the Active Directory (AD) server, run the following commands to create a Service Principal Name (SPN) for the domain account that will be used for database monitoring.
setspn -A MSSQLSvc/<FQDN_of_MS_SQL_Server>:1433 <Domain>\<username>
setspn -A HTTP/<FQDN_of_MS_SQL_Server>:1433 <Domain>\<username> setspn -A HTTPS/<FQDN_of_MS_SQL_Server>:1433 <Domain>\<username> -
In the
entuity.cfgfile, located in entuity_home/etc, add the following section supplying therealmandkdcfor your domain.- Note,
realmis the domain (AD Server) in all capitals, andkdcis the domain as is (either in all lower-case letters or mixed).
[winrm] realm=ENTUITY.COM kdc=Entuity.com
- Note,
- Edit the
kerberosAssetStore.txtfile, located in entuity_home/etc/CollectionEngine, by adding the IP addresses of the Microsoft SQL Server(s). - Save and close both the
entuity.cfgandkerberosAssetStore.txtfiles. - Run
configurefollowed by restarting the Entuity server.
MongoDB:
To monitor the database, configure a user so that the database can connect to and from an external host with privileges, allowing the user to query the database.
- Add the following required JAR files to the entuity_home/
lib/collectionEnginedirectory:mongodb-bson.jarmongodb-driver-core.jarmongodb-java-driver.jar
- Navigate to the entuity_home\
etcdirectory and open thestartup_[UNIX|WIN32].cfgfile. -
In the [
collectionEngine] section of the file, after the line starting with '-cp', add the following:=${EPS}${ENTUITY_HOME}${FPS}lib${FPS}collectionEngine${FPS}mongodb-bson.jar =${EPS}${ENTUITY_HOME}${FPS}lib${FPS}collectionEngine${FPS}mongodb-driver-core.jar =${EPS}${ENTUITY_HOME}${FPS}lib${FPS}collectionEngine${FPS}mongodb-java-driver.jar - Save and close the
startup_[UNIX|WIN32].cfgfile. - Run
configure, followed by restarting the Entuity server. - Connect to the MongoDB database server and bind the IP address of the server in the
mongod.conf(net.bindIp) configuration file. -
Within the MongoDB shell, run the following command, supplying the role name to create a role for the database user that will be used for monitoring.
Note,dbAdminrole can be used instead of creating a custom role.db.createRole({ role: "role name", privileges: [ { resource: { db: "", collection: "" }, actions: ["listCollections"] }, { resource: { db: "admin", collection: "system.version" }, actions: ["find", "collStats"] }, { resource: { db: "admin", collection: "system.users" }, actions: ["find", "collStats"] }, { resource: { db: "admin", collection: "system.roles" }, actions: ["find", "collStats"] }, { resource: { db: "", collection: "system.profile" }, actions: ["find", "collStats"] } ], roles: [ { role: "clusterMonitor", db: "admin" } ] }) -
Run the following command, supplying the username and password to create a new user for monitoring that uses the role created in the previous step.
db.createUser({ user: "username", pwd: "password", roles: [ "role name" ], mechanisms: [ "SCRAM-SHA-256" ] })
Oracle:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query the database.
- Connect to the Oracle database with an account that has the CREATE USER system privilege.
-
Run the command below supplying the username and password to create a new user for monitoring.
Note, if a common user is created the “C##” is required as a prefix before the username.
CREATE USER username IDENTIFIED BY password; - To grant permissions to the new user account, execute one of the following:
-
To grant SELECT access (read-only) to everything, execute the SQL statement below.
GRANT CREATE SESSION, SELECT ANY DICTIONARY, SELECT ANY TABLE, UNDER ANY VIEW, UNLIMITED TABLESPACE to username; -
To grant minimal SELECT permissions, execute the statements below.
GRANT CREATE SESSION to username; GRANT SELECT on sys.dba_data_files to username; GRANT SELECT on sys.dba_temp_files to username; GRANT SELECT on sys.dba_tablespaces to username; GRANT SELECT on sys.dba_free_space to username; GRANT SELECT on sys.dba_indexes to username; GRANT SELECT on sys.v_$datafile to username; GRANT SELECT on sys.v_$instance to username; GRANT SELECT on sys.v_$sysstat to username; GRANT SELECT on sys.gv_$session to username; GRANT SELECT on sys.v_$resource_limit to username; GRANT SELECT on sys.v_$parameter to username; GRANT SELECT on sys.v_$log to username; GRANT SELECT on sys.v_$filestat to username; GRANT SELECT on sys.dba_scheduler_jobs to username; GRANT SELECT on sys.dba_schedular_running_jobs to username; GRANT SELECT on sys.v$version to username; GRANT SELECT on sys.v$sql to username; GRANT SELECT on sys.v$sga to username; GRANT SELECT on sys.v$process to username; GRANT SELECT on sys.v$osstat to username; GRANT SELECT on sys.v$temp_space_header to username;
-
PostgreSQL:
To monitor the database, configure a user needs so that the database can connect to and from an external host with privileges, allowing the user to query the database.
- Add the
postgresql-jdbc-driver.jarrequired JAR file to the entuity_home/lib/collectionEnginedirectory. - Navigate to the entuity_home\
etcdirectory and open thestartup_[UNIX|WIN32].cfgfile. -
In the [
collectionEngine] section of the file, after the line starting with '-cp', add the following:=${EPS}${ENTUITY_HOME}${FPS}lib${FPS}collectionEngine${FPS}postgresql-jdbc-driver.jar - Save and close the
startup_[UNIX|WIN32].cfgfile. - Run
configurefollowed by restarting the Entuity server. -
To allow the database to listen for all IP addresses, or for the IP address of the Entuity server, modify the
postgresql.confconfiguration file. The following example allows the database to listen for all IP addresses:listen_addresses = '*'
-
Add an entry in the
pg_hba.conffile to configure client authentication. For example, this entry allows a host connection to any database, using any user from any IP address, and usingmd5for authentication:host all username 0.0.0.0/0 scram-sha-256
-
Create a user by connecting to the
psqlcommand-line interface, and then running the following command.CREATE USER username WITH PASSWORD 'password';
-
Grant the monitoring role to the newly created user.
GRANT pg_monitor TO username;
- Create and enable the
pg_stat_statementsextension to monitor query metrics across the database and schemas:-
Navigate to the
postgresql.confconfiguration file, and add the following line to the file.shared_preload_libraries = 'pg_stat_statements'
-
If the extension doesn't exist, create the extension by running the following command through the
psqlcommand-line interface.CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
- Optionally add these additional lines to further fine-tune the aggregated query metrics that are collected:
-
pg_stat_statements.track = ALL(includes statements from functions and stored procedures in aggregating query metrics) -
pg_stat_statements.max = 10000(increases the number of normalized queries used for aggregated query metrics) -
pg_stat_statements.track_utility = off(disablesprepareandexplaincommands from being tracked for aggregated query metrics)
-
- Restart the database.
-
-
Create and enable the
pg_buffercacheextension to monitor schema buffer metrics by connecting to thepsqlcommand-line interface and run the following command.CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
- To optionally monitor database jobs, install and/or enable the
pgagentextension.
SAP HANA:
To monitor the database, a user needs to be configured so that the database can be connected to from an external host with privileges allowing the user to query the database.
- Add the
saphana-jdbc-driver.jarrequired JAR files to the entuity_home/lib/collectionEnginedirectory. - Navigate to the entuity_home\
etcdirectory and open thestartup_[UNIX|WIN32].cfgfile. -
In the [
collectionEngine] section of the file, after the line starting with '-cp', add the following:=${EPS}${ENTUITY_HOME}${FPS}lib${FPS}collectionEngine${FPS}saphana-jdbc-driver.jar - Save and close the
startup_[UNIX|WIN32].cfgfile. - Run
configurefollowed by restarting the Entuity server. -
Create a user by connecting to the
hdbsqlcommand-line interface, and then running the following command.- Note, you can optionally add 'NO FORCE_FIRST_PASSWORD_CHANGE' after the password to avoid needing to log in as the user and set a new password.
CREATE USER username PASSWORD "password";
-
Grant the monitoring role to the newly created user.
GRANT MONITORING TO username;
-
To optionally disable password expiration, run the following command.
ALTER USER username DISABLE PASSWORD LIFETIME;
Matrix of Metrics per Monitoring Type:
The following table lists the metrics available for each type of monitoring.
| Attributes | Azure SQL | MySQL | Oracle | MS SQL | MongoDB | PostgreSQL | SAP HANA |
|---|---|---|---|---|---|---|---|
| Database Instance | |||||||
| Database File Path Location | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Database System Version | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Database Type | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Database Version | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| Backup Timestamp | ✓ | ✓ | N/A | ✓ | ✓ | N/A | ✓ |
| Type of Recovery Model | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| Average Query Time | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Buffer Cache Hit Ratio | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Connections Active (Count) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | N/A |
| Connections Attempted (Count) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | N/A |
| Connection Errors (Count) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | N/A |
| Connection Errors Rate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Connections Max Limit | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Connections Usage Rate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| I/O Misc Latency (ms) | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | N/A |
| I/O Read Latency (ms) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| I/O Write Latency (ms) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| IOPS Misc. | ✓ | ✓ | N/A | N/A | ✓ | ✓ | ✓ |
| IOPS Read | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| IOPS Write | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| IOPS Total | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Lock Waits (Count) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Lock Contention Rate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| MBPS Received | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| MBPS Sent | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| MBPS Total | ✓ | N/A | ✓ | ✓ | ✓ | N/A | ✓ |
| Memory Allocated | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Memory Total | ✓ | N/A | ✓ | ✓ | ✓ | ✓ | ✓ |
| Memory Used | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Memory Used % | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Processor Utilization % | ✓ | ✓ | ✓ | ✓ | N/A | N/A | ✓ |
| Query Delete Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Fetch Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Insert Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Update Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Rate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Log Space Remaining | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Space Remaining | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Space Remaining % | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Slow Queries | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| State Latency | ✓ | ✓ | ✓ | ✓ | N/A | N/A | N/A |
| Space Total | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Current Uptime | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Space Used | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Space Used % | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Status | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Status Detail | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Throughput Received (Per Second) | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Throughput Received (Per Second) | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Throughput Total (Per Second) | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | ✓ |
| Schema/Tablespace | |||||||
| Schema Name | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Average Query Time | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| Buffer Allocated | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | N/A |
| Buffer Data | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | N/A |
| Buffer Pages | ✓ | ✓ | N/A | N/A | N/A | ✓ | N/A |
| Buffer Pages Cached | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | N/A |
| Buffer Pool Free | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | N/A |
| Buffer Rows Cached | ✓ | ✓ | N/A | ✓ | ✓ | N/A | N/A |
| Indexes | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| I/O Misc Latency (ms) | ✓ | ✓ | N/A | ✓ | ✓ | N/A | N/A |
| I/O Read Latency (ms) | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
| I/O Write Latency (ms) | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
| IOPS Misc. | ✓ | ✓ | N/A | N/A | ✓ | N/A | ✓ |
| IOPS Read | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| IOPS Write | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| IOPS Total | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Query Delete Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Fetch Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Insert Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Update Latency (ms) | ✓ | ✓ | ✓ | N/A | N/A | ✓ | ✓ |
| Query Rate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Total Space Allocated | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Unused Indexes | ✓ | ✓ | N/A | ✓ | N/A | ✓ | ✓ |
| Used Space | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
| Used Space % | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
| Engine | |||||||
| Name | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| Description | ✓ | ✓ | N/A | ✓ | ✓ | ✓ | ✓ |
| Nodes | |||||||
| Name | N/A | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Mode | N/A | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Role | N/A | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Jobs | |||||||
| Host | ✓ | ✓ | ✓ | ✓ | N/A | ✓ | ✓ |
| Name | ✓ | ✓ | ✓ | ✓ | N/A | ✓ | ✓ |
| Schema | ✓ | ✓ | N/A | ✓ | N/A | N/A | ✓ |
| Type | ✓ | ✓ | ✓ | ✓ | N/A | ✓ | ✓ |
| Duration | ✓ | N/A | ✓ | ✓ | N/A | N/A | ✓ |
| Last Executed | ✓ | ✓ | ✓ | ✓ | N/A | ✓ | ✓ |
| Status | ✓ | ✓ | ✓ | ✓ | N/A | ✓ | ✓ |
| Tables | |||||||
| Name | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Schema | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Status | ✓ | ✓ | ✓ | ✓ | N/A | N/A | N/A |
| Total Space | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Used Space | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
| Used Space % | ✓ | ✓ | ✓ | ✓ | ✓ | N/A | N/A |
Comments
0 comments
Please sign in to leave a comment.