[root@king01 ~]# yum -y install perl-ExtUtils-MakeMaker perl-Time-HiRes [root@king01 ~]# tar zxvf DBI-1.637.tar.gz [root@king01 ~]# cd DBI-1.637 [root@king01 DBI-1.637]# perl Makefile.PL [root@king01 DBI-1.637]# make all [root@king01 DBI-1.637]# make install [root@king01 ~]# export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 [root@king01 ~]# tar zxvf DBD-Oracle-1.74.tar.gz [root@king01 ~]# cd DBD-Oracle-1.74 [root@king01 DBD-Oracle-1.74]# perl Makefile.PL [root@king01 DBD-Oracle-1.74]# make all [root@king01 DBD-Oracle-1.74]# make install [root@king01 ~]# tar zxvf check_oracle_health-3.1.2.2.tar.gz [root@king01 ~]# cd check_oracle_health-3.1.2.2 [root@king01 check_oracle_health-3.1.2.2]# ./configure --prefix=/usr/local/icinga \ --with-nagios-user=icinga \ --with-nagios-group=icinga \ --with-mymodules-dir=/usr/local/icinga/libexec [root@king01 check_oracle_health--3.1.2.2]# make all [root@king01 check_oracle_health--3.1.2.2]# make install [root@king01 ~]# vi /etc/ld.so.conf /u01/app/oracle/product/11.2.0/db_1/lib [root@king01 ~]# ldconfig [root@king01 ~]# su - oracle [oracle@king01 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin/ [oracle@king01 admin]$ vi tnsnames.ora # tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. ZXMDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.202)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = king) ) ) [oracle@king01 ~]$ tnsping zxmdb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 06-AUG-2018 14:00:26 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.202)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = king))) OK (0 msec) [root@king01 ~]# cd /usr/local/icinga/libexec/ [root@king01 libexec]# vi check_oracle_health $ENV{"ORACLE_HOME"} = "/u01/app/oracle/product/11.2.0/db_1"; [root@king01 libexec]# ./check_oracle_health --connect=zxmdb --username=system --password=oracle --mode=tnsping OK - connection established to zxmdb. [root@king01 libexec]# ./check_oracle_health --connect=zxmdb --username=system --password=oracle --mode=connection-time OK - 0.06 seconds to connect as SYSTEM | connection_time=0.0598;1;5
开源监控解决方案:ICINGA(Nagios)监控Oracle Database
猜你喜欢
转载自blog.51cto.com/13598811/2155335
今日推荐
周排行