How to monitor oracle database using zabbix agent2

How to monitor oracle database using zabbix agent2

Overview

In zabbix version 5.0 and above, a new feature is added, that is zabbix-agent2, which is an agent rewritten by zabbix company using go language, which can completely replace the original zabbix-agent. This proxy is much more powerful than the original one, and has many built-in plug-ins to support monitoring of basic resources. Here I choose the Oracle plug-in to see which indicators zabbix-agent2 can support monitoring.

Install

Install zabbix-agent2 Here we use the official repo provided by zabbix for installation

rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum insall -y zabbix-agent2

Configure the /etc/zabbix/zabbix_agent2.conf file, modify the Server attribute value, run the zabbix server to poll it for data, and install oracleInstant. The oracleInstant package provided by Oracle is also used for installation.

rpm -ivh https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm

Setting Oracle environment variables

ORACLE_HOME=/usr/lib/oracle/21/client64;export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib64:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH

Configure the Oracle monitoring account

Create an Oracle monitoring account and authorization

CREATE USER zabbix_mon IDENTIFIED BY zabbix_pass;
-- Grant access to the zabbix_mon user.
GRANT CONNECT, CREATE SESSION TO zabbix_mon;
GRANT SELECT ON DBA_TABLESPACE_USAGE_METRICS TO zabbix_mon;
GRANT SELECT ON DBA_TABLESPACES TO zabbix_mon;
GRANT SELECT ON DBA_USERS TO zabbix_mon;
GRANT SELECT ON DBA_DATA_FILES TO zabbix_mon;
GRANT SELECT ON DBA_FREE_SPACE TO zabbix_mon;
GRANT SELECT ON DBA_TEMP_FILES to zabbix_mon;
GRANT SELECT ON GV_$SORT_SEGMENT to zabbix_mon;
GRANT SELECT ON V_$ACTIVE_SESSION_HISTORY TO zabbix_mon;
GRANT SELECT ON V_$ARCHIVE_DEST TO zabbix_mon;
GRANT SELECT ON V_$ASM_DISKGROUP TO zabbix_mon;
GRANT SELECT ON V_$DATABASE TO zabbix_mon;
GRANT SELECT ON V_$DATAFILE TO zabbix_mon;
GRANT SELECT ON V_$INSTANCE TO zabbix_mon;
GRANT SELECT ON V_$LOG TO zabbix_mon;
GRANT SELECT ON V_$OSSTAT TO zabbix_mon;
GRANT SELECT ON V_$PGASTAT TO zabbix_mon;
GRANT SELECT ON V_$PARAMETER TO zabbix_mon;
GRANT SELECT ON V_$PROCESS TO zabbix_mon;
GRANT SELECT ON V_$RECOVERY_FILE_DEST TO zabbix_mon;
GRANT SELECT ON V_$RESTORE_POINT TO zabbix_mon;
GRANT SELECT ON V_$RESTORE_POINT TO zabbix_mon;
GRANT SELECT ON V_$SESSION TO zabbix_mon;
GRANT SELECT ON V_$SGASTAT TO zabbix_mon;
GRANT SELECT ON V_$SYSMETRIC TO zabbix_mon;
GRANT SELECT ON V_$SYSTEM_PARAMETER TO zabbix_mon;
GRANT SELECT ON V_$PDBS TO zabbix_mon;
GRANT SELECT ON V_$SYSTEM_PARAMETER to zabbix_mon;

Configure the zabbix-agent2 configuration file. To facilitate Oracle monitoring and management, it is recommended to use a new configuration file and place it in /etc/zabbix/zabbix_agent2.d. The configuration content is as follows:

[root@vcenter zabbix_agent2.d]# cat monitor_oracle.conf 
Plugins.Oracle.Sessions.demo.Uri=tcp://172.20.20.150:1521
Plugins.Oracle.Sessions.demo.User=zabbix_mon
Plugins.Oracle.Sessions.demo.Password=zabbix_pass
Plugins.Oracle.Sessions.demo.Service=demopdb

Configuring Host Templates

insert image description here

The template that comes with zabbix already monitors Oracle indicators. Here we need to set the corresponding macro variables to point to our Oracle database.

This is the end of this article about zabbix agent2 monitoring oracle database. For more relevant zabbix monitoring oracle database content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to deploy zabbix_agent in docker
  • Installation and configuration method of Zabbix Agent on Linux platform
  • Install and configure Zabbix Agentd on Windows
  • Zabbix implements batch monitoring of port status
  • How to monitor multiple JVM processes in Zabbix
  • Detailed process of zabbix monitoring process and port through agent

<<:  MySQL query optimization: a table optimization solution for 1 million data

>>:  Example code for implementing raindrop animation effect with CSS

Recommend

Life cycle and hook functions in Vue

Table of contents 1. What is the life cycle 2. Th...

Solve the problem of Tomcat10 Catalina log garbled characters

Running environment, Idea2020 version, Tomcat10, ...

Understanding of CSS selector weight (personal test)

Copy code The code is as follows: <style type=...

Tutorial on building nextcloud personal network disk with Docker

Table of contents 1. Introduction 2. Deployment E...

Apache Spark 2.0 jobs take a long time to finish when they are finished

Phenomenon When using Apache Spark 2.x, you may e...

About the IE label LI text wrapping problem

I struggled with this for a long time, and after s...

Reasons why MySQL cancelled Query Cache

MySQL previously had a query cache, Query Cache. ...

How to display TIF format images in browser

The browser displays TIF format images Copy code T...

The concept and characteristics of MySQL custom variables

A MySQL custom value is a temporary container for...

Detailed explanation of JavaScript implementation of hash table

Table of contents 1. Hash table principle 2. The ...

Understand the implementation of Nginx location matching in one article

Since the team is separating the front-end and ba...

A summary of the reasons why Mysql does not use date field index

Table of contents background explore Summarize ba...