概述
在zabbix5.0版本以上,新增了一個(gè)特性,那就是zabbix-agent2,這個(gè)是zabbix公司使用go語言重寫的一個(gè)代理,可以完全替代原來的zabbix-agent。這個(gè)代理功能比原來的要強(qiáng)大的多,內(nèi)置了很多個(gè)插件支持對(duì)基礎(chǔ)資源的監(jiān)控。這里我選用oracle的插件,來看看zabbix-agent2可以支持監(jiān)控哪些指標(biāo)。
安裝
安裝zabbix-agent2 這里采用zabbix提供的官方repo,進(jìn)行安裝
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
配置/etc/zabbix/zabbix_agent2.conf文件,修改Server屬性值,運(yùn)行zabbix服務(wù)器對(duì)其進(jìn)行輪詢?nèi)?shù) 安裝oracleInstant 這里也是采用oracle提供的oracleInstant包進(jìn)行安裝
rpm -ivh https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
設(shè)置oracle環(huán)境變量
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
配置oracle監(jiān)控賬戶
創(chuàng)建oracle監(jiān)控賬號(hào)以及授權(quán)
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;
配置zabbix-agent2配置文件 為了方便oracle監(jiān)控管理,建議使用新的配置文件,放置在/etc/zabbix/zabbix_agent2.d鐘,配置內(nèi)容如下:
[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
配置主機(jī)模板
zabbix自帶的模板已經(jīng)有了對(duì)Oracle指標(biāo)的監(jiān)控,這里我們需要對(duì)相應(yīng)的宏變量進(jìn)行設(shè)置,指向我們的oracle數(shù)據(jù)庫即可。
到此這篇關(guān)于zabbix agent2 監(jiān)控oracle數(shù)據(jù)庫的文章就介紹到這了,更多相關(guān)zabbix監(jiān)控oracle數(shù)據(jù)庫內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!