zabbix로 Oracle 모니터링

Orabbix 다운로드


$ sudo mkdir /opt/orabbix
$ sudo unzip /opt/orabbix/orabbix-1.2.3.zip 
$ sudo cp /opt/orabbix/init.d/orabbix /etc/init.d
$ sudo chmod u+x /etc/init.d/orabbix 
$ sudo chmod u+x /opt/orabbix/run.sh 


htp://그래서 넉넉하다. 네 t / p 로지 cts / 오라비 x / 훗 ぇ s / ㄴ st / 드 w ぉ 아 d
에서 orabbix-1.2.3.zip을 다운로드/opt/orabbix에 배치.
파일의 압축을 풀고 필요한 파일을 복사합니다.

ORACLE 측 설정


Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
に接続されました。
SQL>

SQL> CREATE USER ZABBIX
IDENTIFIED BY [任意のパスワード]
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;

SQL> GRANT ALTER SESSION TO ZABBIX;

SQL> GRANT CREATE SESSION TO ZABBIX;

SQL> GRANT CONNECT TO ZABBIX;

SQL> ALTER USER ZABBIX DEFAULT ROLE ALL;

SQL> GRANT SELECT ON V_$INSTANCE TO ZABBIX;

SQL> GRANT SELECT ON DBA_USERS TO ZABBIX;

SQL> GRANT SELECT ON V_$LOG_HISTORY TO ZABBIX;

SQL> GRANT SELECT ON V_$PARAMETER TO ZABBIX;

SQL> GRANT SELECT ON SYS.DBA_AUDIT_SESSION TO ZABBIX;

SQL> GRANT SELECT ON V_$LOCK TO ZABBIX;

SQL> GRANT SELECT ON DBA_REGISTRY TO ZABBIX;

SQL> GRANT SELECT ON V_$LIBRARYCACHE TO ZABBIX;

SQL> GRANT SELECT ON V_$SYSSTAT TO ZABBIX;

SQL> GRANT SELECT ON V_$PARAMETER TO ZABBIX;

SQL> GRANT SELECT ON V_$LATCH TO ZABBIX;

SQL> GRANT SELECT ON V_$PGASTAT TO ZABBIX;

SQL> GRANT SELECT ON V_$SGASTAT TO ZABBIX;

SQL> GRANT SELECT ON V_$LIBRARYCACHE TO ZABBIX;

SQL> GRANT SELECT ON V_$PROCESS TO ZABBIX;

SQL> GRANT SELECT ON DBA_DATA_FILES TO ZABBIX;

SQL> GRANT SELECT ON DBA_TEMP_FILES TO ZABBIX;

SQL> GRANT SELECT ON DBA_FREE_SPACE TO ZABBIX;

SQL> GRANT SELECT ON V_$SYSTEM_EVENT TO ZABBIX;

SQL>  exec dbms_network_acl_admin.create_acl(acl => 'resolve.xml',description => 'resolve acl', principal =>'ZABBIX', is_grant => true, privilege => 'resolve');
 exec dbms_network_acl_admin.assign_acl(acl => 'resolve.xml', host =>'*');
 commit;

SQL> select utl_inaddr.get_host_name('127.0.0.1') from dual;

Oracle 11g XE를 Windows 기기에 설치하여 연결용 사용자 작성 및 권한 부여를 실시.

템플릿 캡처





/opt/orabbix/template/Orabbix_export_full.xml을 Zabbix로 가져옵니다.

설정 파일 만들기


$ sudo cp /opt/orabbix/conf/config.props.sample /opt/orabbix/conf/config.props
$ sudo vi /opt/orabbix/conf/config.props

#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer1

ZabbixServer1.Address=XXX.XXX.XXX.XXX
ZabbixServer1.Port=10051

#pidFile
OrabbixDaemon.PidFile=./logs/orabbix.pid
#frequency of item's refresh
OrabbixDaemon.Sleep=300
#MaxThreadNumber should be >= than the number of your databases
OrabbixDaemon.MaxThreadNumber=100

#put here your databases in a comma separated list
DatabaseList=XE

#Configuration of Connection pool
#if not specified Orabbis is going to use default values (hardcoded)
#Maximum number of active connection inside pool
DatabaseList.MaxActive=10

#The maximum number of milliseconds that the pool will wait
#(when there are no available connections) for a connection to be returned
#before throwing an exception, or <= 0 to wait indefinitely.
DatabaseList.MaxWait=100
DatabaseList.MaxIdle=1
#define here your connection string for each database
XE.Url=jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:XE
XE.User=XXXXXX
XE.Password=XXXXXX
#Those values are optionals if not specified Orabbix is going to use the general values
XE.MaxActive=10
XE.MaxWait=100
XE.MaxIdle=1
XE.QueryListFile=./conf/query.props

/opt/orabbix/conf/config.props 파일을 복사하여 만듭니다.
DatabaseList=XE는, 호스트 등록시에 사용하는 호스트명과 통일한다.

시작 파일 변경


$ sudo vi /etc/init.d/orabbix

# Source function library.
. /lib/lsb//init-functions

# Get config.
# . /etc/sysconfig/network

/lib/lsb//init-functions 데비안의 경로 변경.
# ./etc/sysconfig/network debian에 대한 주석 처리.
start(){
        echo -n "Starting Orabbix service:"
        cd $orabbix
        $startup
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/orabbix
        return $RETVAL
}

stop(){
        echo -n "Stopping Orabbix service:"
        pid=`ps -ef  |grep java |grep orabbix | awk '{ print $2 }'`
        kill `cat $orabbix/logs/orabbix.pid`
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f  /var/lock/orabbix
        return $RETVAL

/var/lock/orabbix 잠금 파일의 경로를 변경했습니다.
$ sudo /etc/init.d/orabbix start

Orabbix를 시작합니다.
 2015-03-05 00:44:46,276 [pool-1-thread-1] INFO  Orabbix - Done with dbJob on database XE QueryList elapsed time 2007 ms
 2015-03-05 00:44:53,393 [main] INFO  Orabbix - Starting Orabbix Version 1.2.3
 2015-03-05 00:44:53,496 [main] INFO  Orabbix - Orabbix started with pid:21594
 2015-03-05 00:44:53,497 [main] INFO  Orabbix - PidFile -> ./logs/orabbix.pid
 2015-03-05 00:44:54,227 [main] INFO  Orabbix - DB Pool created: org.apache.commons.dbcp.datasources.SharedPoolDataSource@1975e01
 2015-03-05 00:44:54,228 [main] INFO  Orabbix - URL=jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:XE
 2015-03-05 00:44:54,228 [main] INFO  Orabbix - maxPoolSize=10
 2015-03-05 00:44:54,228 [main] INFO  Orabbix - maxIdleSize=1
 2015-03-05 00:44:54,229 [main] INFO  Orabbix - maxIdleTime=1800000ms
 2015-03-05 00:44:54,229 [main] INFO  Orabbix - poolTimeout=100
 2015-03-05 00:44:54,229 [main] INFO  Orabbix - timeBetweenEvictionRunsMillis=-1
 2015-03-05 00:44:54,229 [main] INFO  Orabbix - numTestsPerEvictionRun=3
 2015-03-05 00:44:58,649 [main] INFO  Orabbix - Connected as ZABBIX
 2015-03-05 00:44:58,656 [main] INFO  Orabbix - --------- on Database -> XE

/opt/orabbix/logs/orabbix.log에서 실행 중인지 확인합니다.
2015-03-05 00:42:32,953 [main] INFO  Orabbix - Starting Orabbix Version 1.2.3
 2015-03-05 00:42:33,034 [main] INFO  Orabbix - Orabbix started with pid:21173
 2015-03-05 00:42:33,034 [main] INFO  Orabbix - PidFile -> ./logs/orabbix.pid
 2015-03-05 00:42:33,043 [main] ERROR Orabbix - Error on Configurator getConnection while getting XE.Url null
 2015-03-05 00:42:33,043 [main] ERROR Orabbix - Error on Configurator getConnection while getting DefaultUser null
 2015-03-05 00:42:33,044 [main] ERROR Orabbix - Error on Configurator getConnection while getting XE.Password null
 2015-03-05 00:42:33,822 [main] INFO  Orabbix - DB Pool created: org.apache.commons.dbcp.datasources.SharedPoolDataSource@1975e01
 2015-03-05 00:42:33,822 [main] INFO  Orabbix - URL=
 2015-03-05 00:42:33,823 [main] INFO  Orabbix - maxPoolSize=10
 2015-03-05 00:42:33,823 [main] INFO  Orabbix - maxIdleSize=1
 2015-03-05 00:42:33,823 [main] INFO  Orabbix - maxIdleTime=1800000ms
 2015-03-05 00:42:33,823 [main] INFO  Orabbix - poolTimeout=100
 2015-03-05 00:42:33,824 [main] INFO  Orabbix - timeBetweenEvictionRunsMillis=-1
 2015-03-05 00:42:33,824 [main] INFO  Orabbix - numTestsPerEvictionRun=3
 2015-03-05 00:42:33,887 [main] ERROR Orabbix - Error on Configurator for database XE -->No suitable driver found for
 2015-03-05 00:42:33,887 [main] INFO  Orabbix - This Database XE removed
 2015-03-05 00:42:33,890 [main] ERROR Orabbix - ERROR on main - Connections is empty

연결 정보 등이 잘못되면 오류가 로그에 기록됩니다.

ZABBIX 호스팅





호스트 이름을 설정 파일을 통합합니다.



가져온 템플릿을 선택합니다.



아래, 문서 및 URL을 참조하십시오.
h tp // w w. s rt 또는 r도 t. 코 m/우우키/그리고 x. php / 오라비 x # 드 w 응 아 d_. 26_ 인 s 타치온
h tp : // sys 확실히. 코 m/포 sts/197746/

좋은 웹페이지 즐겨찾기