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

Detailed explanation of vue-router 4 usage examples

Table of contents 1. Install and create an instan...

What is web design

<br />Original article: http://www.alistapar...

Detailed explanation of Linux netstat command

Table of contents Linux netstat command 1. Detail...

Detailed installation process of MySQL 8.0 Windows zip package version

The installation process of MySQL 8.0 Windows zip...

How to align text boxes in multiple forms in HTML

The form code is as shown in the figure. The styl...

Detailed steps for installing MySQL using cluster rpm

Install MySQL database a) Download the MySQL sour...

Professional and non-professional web design

First of all, the formation of web page style main...

iframe parameters with instructions and examples

<iframe src=”test.jsp” width=”100″ height=”50″...

Introduction to ufw firewall in Linux

Let's take a look at ufw (Uncomplicated Firew...

Thoughts on truncation of multi-line text with a "show more" button

I just happened to encounter this small requireme...

Detailed explanation of the practical use of HTML table layout

When is the table used? Nowadays, tables are gene...

Linux sar command usage and code example analysis

1. CPU utilization sar -p (view all day) sar -u 1...