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

How to operate Linux file and folder permissions

Linux file permissions First, let's check the...

How to write transparent CSS for images using filters

How to write transparent CSS for images using filt...

Markup Languages ​​- Lists Again

Click here to return to the 123WORDPRESS.COM HTML ...

Nine advanced methods for deduplicating JS arrays (proven and effective)

Preface The general methods are not listed here, ...

Implementation of Docker deployment of Tomcat and Web applications

1. Download docker online yum install -y epel-rel...

How to split data in MySQL table and database

Table of contents 1. Vertical (longitudinal) slic...

Detailed explanation of CSS margin overlap and solution exploration

I recently reviewed some CSS-related knowledge po...

W3C Tutorial (16): Other W3C Activities

This section provides an overview of some other i...

Detailed explanation of LVM seamless disk horizontal expansion based on Linux

environment name property CPU x5650 Memory 4G dis...

vue front-end HbuliderEslint real-time verification automatic repair settings

Table of contents ESLint plugin installation in H...

Detailed explanation of fuser command usage in Linux

describe: fuser can show which program is current...

MySQL 5.6 installation steps with pictures and text

MySQL is an open source small relational database...