G_odbc

1.安装以下两个patch

omnibus-3.6-linux2x86-gateway-libgatecrypt-0_0

omnibus-3.6-linux2x86-gateway-nco-g-odbc-4_0

查看安装的patch.

[root@hejun /opt/netcool/omnibus/install]# ./nco_patch -print
---------------------------------------------------------------------
INSTALLED PATCHES
---------------------------------------------------------------------
Patch common-libodbc-drivers-1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Netcool/OMNIbus Library for ODBC Probes & Gateways
            Revision : 0
            Requires : common-upgrade-3.6
           Obsoletes : common-libodbc-4.2 common-libodbc-5.0 common-libodbc-5.1 common-libodbc-drivers-0
   Installation Date : Mon Nov 23 22:48:05 EST 2009
---------------------------------------------------------------------
Patch gateway-libgatecrypt-0
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Gateway configuration encryption library
            Revision : 0
            Requires : common-upgrade-3.6
           Obsoletes :
   Installation Date : Tue Nov 24 00:11:44 EST 2009
---------------------------------------------------------------------
Patch gateway-nco-g-odbc-4
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Netcool/OMNIbus Gateway for ODBC
            Revision : 0
            Requires : gateway-libgatecrypt-0 common-libodbc-drivers-0 common-upgrade-3.6
           Obsoletes : gateway-nco-g-odbc-3 gateway-nco-g-odbc-2 gateway-nco-g-odbc-1 gateway-nco-g-odbc-0 gateway-nco-g-odbc
   Installation Date : Tue Nov 24 00:15:03 EST 2009
---------------------------------------------------------------------
Patch probe-nco-p-syslog-4
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Syslog probe update
            Revision : 0
            Requires : probe-compatibility-3.x
           Obsoletes : probe-nco-p-syslog probe-nco-p-syslog-1 probe-nco-p-syslog-2 probe-nco-p-syslog-3
   Installation Date : Thu Nov 5 09:48:55 EST 2009
---------------------------------------------------------------------
Patch probe-nco-p-tivoli-eif-2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Netcool/OMNIbus Tivoli EIF probe
            Revision : 1
            Requires : probe-compatibility-3.x probe-nonnative-base-1
           Obsoletes : probe-nco-p-tme10tecad probe-nco-p-tme10tecad-2 probe-nco-p-tme10tecad-3 probe-nco-p-tme10tecad-4 probe-nco-p-tivoli-eif-1
   Installation Date : Tue Nov 10 21:20:45 EST 2009
---------------------------------------------------------------------
Patch probe-nonnative-base-1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   Short Description : Nonnative probe server
            Revision : 0
            Requires : probe-compatibility-3.x
           Obsoletes : probe-nco-p-nonnative probe-nco-p-nonnative-1 probe-nco-p-nonnative-2 probe-nco-p-nonnative-3 probe-nco-p-nonnative-4 probe-nco-p-nonnative-5 probe-nco-p-nonnative-6 probe-nco-p-nonnative-java-2 probe-nco-p-nonnative-java-1 probe-nco-p-nonnative-java probe-nco-p-nonnative-scripts
   Installation Date : Thu Nov 5 09:49:07 EST 2009
---------------------------------------------------------------------
[root@hejun /opt/netcool/omnibus/install]#
将odbc.ini 和G_ODBC.conf两个文件拷贝到$OMNIHOME/etc/下,文件位置如下

root@hejun /opt/netcool/omnibus/gates/odbc]# ls
db2  informix  mssql  odbc.ini  sybase
[root@hejun /opt/netcool/omnibus/gates/odbc]# cd db2
[root@hejun /opt/netcool/omnibus/gates/odbc/db2]# ls
G_ODBC.conf  db2_details.sql  db2_journal.sql  db2_status.sql
[root@hejun /opt/netcool/omnibus/gates/odbc/db2]#

配置以上两个文件如下

odbc.ini

[ODBC Data Sources]
DB2=DataDirect 5.3 DB2 Wire Protocol Driver
INFORMIX_WIRE=DataDirect 5.3 Informix Wire Protocol Driver
MSSQL=DataDirect 5.3 MS SQL Server Wire Protocol Driver
SYBASE=DataDirect 5.3 Sybase Wire Protocol Driver


[DB2]
Driver=/opt/netcool/omnibus/platform/linux2x86/lib/BMdb223.so
Description=DataDirect 5.3 DB2 Wire Protocol
AddStringToCreateTable=
AlternateID=
AlternateServers=
ApplicationUsingThreads=1
CatalogSchema=
CharsetFor65535=0
ConnectionRetryCount=0
ConnectionRetryDelay=3
#Database applies to DB2 UDB only
Database=ALERTS
DynamicSections=200
GrantAuthid=PUBLIC
GrantExecute=1
IpAddress=192.168.100.145
LoadBalancing=0
LogonID=db2inst1
Password=tivoli
PackageCollection=NULLID
PackageOwner=
ReportCodePageConversionErrors=0
SecurityMechanism=0
TcpPort=50000
UseCurrentSchema=1
WithHold=1


[INFORMIX_WIRE]
Driver=/platform//lib/BMifcl23.so
Description=DataDirect 5.3 Informix Wire Protocol
AlternateServers=
ApplicationUsingThreads=1
CancelDetectInterval=0
ConnectionRetryCount=0
ConnectionRetryDelay=3
Database=
HostName=
LoadBalancing=0
LogonID=
Password=
PortNumber=
ServerName=
TrimBlankFromIndexName=1


[MSSQL]
Driver=/platform//lib/BMmsss23.so
Description=DataDirect 5.3 SQL Server Wire Protocol
Address=
AlternateServers=
AnsiNPW=Yes
ConnectionRetryCount=0
ConnectionRetryDelay=3
Database=
LoadBalancing=0
LogonID=
Password=
QuotedId=No

[SYBASE]
Driver=/platform//lib/BMase23.so
Description=DataDirect 5.3 Sybase Wire Protocol
AlternateServers=
ApplicationName=
ApplicationUsingThreads=1
ArraySize=50
Charset=
ConnectionRetryCount=0
ConnectionRetryDelay=3
CursorCacheSize=1
Database=
DefaultLongDataBuffLen=1024
EnableDescribeParam=0
EnableQuotedIdentifiers=0
InitializationString=
Language=
LoadBalancing=0
LogonID=
NetworkAddress=
OptimizePrepare=1
PacketSize=0
Password=
RaiseErrorPositionBehavior=0
ReportCodePageConversionErrors=0
SelectMethod=0
TruncateTimeTypeFractions=0
WorkStationID=

[ODBC]
IANAAppCodePage=4
InstallDir=/platform/
Trace=0
TraceDll=/platform//lib/odbctrac.so
TraceFile=odbctrace.out
UseCursorLib=0

G_ODBC.conf

########################################################################
#
#       Licensed Materials - Property of IBM
#      
#      
#      
#       (C) Copyright IBM Corp. 2007. All Rights Reserved
#      
#       US Government Users Restricted Rights - Use, duplication
#       or disclosure restricted by GSA ADP Schedule Contract
#       with IBM Corp.
#
########################################################################

#
# Example ODBC configuration for the Netcool/OMNIbus ODBC Gateway
#


#
# Create a mapping from the Object Server's fields into ODBC fields
#
# Fields marked ON INSERT ONLY will only be set when the entry is created
# for the first time (ie. they will not be updated)
#
# Ordering in these maps is IMPORTANT ! A SQL insert statement is constructed
# so the order of fields in the mapping must match the order in the database
# table.
#

CREATE MAPPING DB2_STATUS_MAP
(
 'ActionTime'   = ACTION_TIME,
 'ActionCode'   = ACTION_CODE,
 'Identifier'   = '@Identifier',
 'Serial'    = '@Serial' CONVERT TO INTEGER,
 'Node'    = '@Node',
 'NodeAlias'   = '@NodeAlias',
 'Manager'   = '@Manager',
 'Agent'    = '@Agent',
 'AlertGroup'   = '@AlertGroup',
 'AlertKey'   = '@AlertKey',
 'Severity'   = '@Severity' CONVERT TO INTEGER,
 'Summary'   = '@Summary',
 'StateChange'   = '@StateChange'     CONVERT TO DATE,
 'FirstOccurrence' = '@FirstOccurrence' CONVERT TO DATE,
 'LastOccurrence'  = '@LastOccurrence'  CONVERT TO DATE,
 'InternalLast'   = '@InternalLast'    CONVERT TO DATE,
 'Poll'    = '@Poll' CONVERT TO INTEGER,
 'Type'    = '@Type' CONVERT TO INTEGER,
 'Tally'    = '@Tally' CONVERT TO INTEGER,
 'Class'    = '@Class' CONVERT TO INTEGER,
 'Grade'    = '@Grade' CONVERT TO INTEGER,
 'Location'   = '@Location',
 'OwnerUID'   = '@OwnerUID' CONVERT TO INTEGER,
 'OwnerGID'   = '@OwnerGID' CONVERT TO INTEGER,
 'Acknowledged'   = '@Acknowledged' CONVERT TO INTEGER,
        'ServerName'      = '@ServerName',
        'ServerSerial'    = '@ServerSerial' CONVERT TO INTEGER
);


CREATE MAPPING DB2_JOURNAL_MAP
(
        'Serial'          = '@Serial' CONVERT TO INTEGER,
        'UID'             = '@UID' CONVERT TO INTEGER,
        'Chrono'          = '@Chrono'          CONVERT TO DATE,
        'Text1'           = '@Text1',
        'Text2'           = '@Text2',
        'Text3'           = '@Text3',
        'Text4'           = '@Text4',
        'Text5'           = '@Text5',
        'Text6'           = '@Text6',
        'Text7'           = '@Text7',
        'Text8'           = '@Text8',
        'Text9'           = '@Text9',
        'Text10'          = '@Text10',
        'Text11'          = '@Text11',
        'Text12'          = '@Text12',
        'Text13'          = '@Text13',
        'Text14'          = '@Text14',
        'Text15'          = '@Text15',
        'Text16'          = '@Text16',
 'ServerName'      = SERVER_NAME,
 'ServerSerial'    = SERVER_SERIAL CONVERT TO INTEGER
);

CREATE MAPPING DB2_DETAILS_MAP
(
        'Identifier'      = '@Identifier',
        'AttrVal'         = '@AttrVal' CONVERT TO INTEGER,
        'Sequence'        = '@Sequence' CONVERT TO INTEGER,
        'Name'            = '@Name',
        'Detail'          = '@Detail',
        'ServerName'      = SERVER_NAME,
        'ServerSerial'    = SERVER_SERIAL CONVERT TO INTEGER
);

#
# Start up the reader - connect to the Object Server HEJUN
#
# This example uses no filtering.
#

START READER HEJUN_READ CONNECT TO HEJUN;

#
# Start up the writer
#
START WRITER DB2_WRITER
(
 TYPE = ODBC,
 REVISION = 1,
 MODULE_REVISION = 7,
 DATA_SOURCE = DB2,
 SOURCE_SERVER = 'HEJUN',
 SAF_MAX_SIZE = 7777777,
  COUNTER_PART = 'HEJUN_READ',

 USERNAME = 'db2inst1',
 PASSWORD = 'tivoli',

 STATUS_TABLE_MAP = DB2_STATUS_MAP,
 DETAILS_TABLE_MAP = DB2_DETAILS_MAP,
 JOURNAL_TABLE_MAP = DB2_JOURNAL_MAP,

 STATUS_TABLE = 'status',
 DETAILS_TABLE = 'details',
 JOURNAL_TABLE = 'journal',

 FORWARD_INSERTS = TRUE,
 FORWARD_UPDATES = TRUE,
 FORWARD_DELETES = TRUE
);

#
# Add a route from the reader to the writer so the info gets passed
#
ADD ROUTE FROM HEJUN_READ TO DB2_WRITER;

#
# End of file
#

3. 创建db2 数据库

修改以下三个sql文件的执行权限

[root@hejun /opt/netcool/omnibus/gates/odbc/db2]# ls
G_ODBC.conf  db2_details.sql  db2_journal.sql  db2_status.sql

切换到db2inst1实例用户.先执行db2_status.sql.后执行其它两个sql.

-- db2_status.sql

-- This script. will creates the alerts database and the status table
-- to store data processed by the Gateway.

-- This scripts must be run BEFORE db2_details.sql and db2_journal.sql

-- To run this script, you must do the following:
--   (1) Put this script. in directory of your choice.
--   (2) At the DB2 command window prompt, run this script.
--       EXAMPLE:    db2 -td@ -vf db2_status.sql

 

4.启动 gateway,执行以下的命令

[root@hejun /opt/netcool/omnibus/bin]# ls -l nco_g_odbc
lrwxrwxrwx 1 root root 7 Nov 24 00:15 nco_g_odbc -> nco_run
[root@hejun /opt/netcool/omnibus/bin]#

 

 


 


 

 


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22775238/viewspace-620457/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22775238/viewspace-620457/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值