Академический Документы
Профессиональный Документы
Культура Документы
JDBC
JDBC
Zabbix Protocol
JDBC
JDBC
Fig. 1 Archivelog
Fig. 6 Sessions
Orabbix Author
.ndrea Dalle +acche) http)&&www.smartmarmot.com
History
$ou can read about the history and evolution of the Orabbix plug%in in these threads below) Original here) http)&&www.'abbix.com&forum&showthread.php;t<=>??? 3atest here) http)&&www.'abbix.com&forum&showthread.php;t<=?>@=
Distribution
$ou can find the latest versions of Orabbix at the locations listed below) http)&&www.smartmarmot.com&product&orabbix&download& or https)&&sourceforge.net&proAects&orabbix&
Requirements
"o use Orabbix, you will re!uire the following on your Zabbix 1erver) * Zabbix =.B.x 1erver * :ava 6untime Environment ? 5urrent known successfully tested Oracle host platforms) * 6#E3C.D ,5entO1 C.E F C.C* /indows GHH> ,with :ava 1E =.?* #7%ID ==.>= * . D C.> 5urrently known tested Oracle +ersions) * =Hg * =H.G ** IMPORTANT** $ou do 4O" need to install an Oracle client of any kind for Orabbix to work. Orabbix uses :ava obAects and connection strings to connect to the Oracle Database, and as such doesnJt re!uire an Oracle client to be installed on your Zabbix 1erver.
Installation
Assumptions
"he installation instructions have been created based on instructions for most Knix deployments ,i.e. 6#E3&5entO1-, and is assumed that any alterations re!uired for your specific environment are to be taken into account accordingly. "his guide is based upon there being two ,G- #osts, =x Zabbix 1erver and =x Oracle 1erver. f you are planning on monitoring an Oracle instance that is running on your Zabbix 1erver, the steps are the same, with minor adAustments re!uired for your connection information.
"he steps also assume you are configuring Orabbix to monitor a new installation or setup of Oracle. "he installation steps will have you 86.4" access for the Zabbix user to all tables, and this will include any I1E6 tables present at the time of execution. f you do not want Zabbix to have access to specific tables or resources within your database, you will need to set a DE4$ to the Zabbix users access as re!uired. 5onsult your D(. for details, as this is beyond the scope of these instructions.
CREATE USER ZABBIX IDENTIFIED BY <REPLACE WITH PASSWORD> DEFAULT TABLESPACE SYSTEM TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK; 2 Roles for ZABBIX GRANT CONNECT TO ZABBIX; GRANT RESOURCE TO ZABBIX; ALTER USER ZABBIX DEFAULT ROLE ALL; 5 System Privileges for ZABBIX GRANT SELECT ANY TABLE TO ZABBIX; GRANT CREATE SESSION TO ZABBIX; GRANT SELECT ANY DICTIONARY TO ZABBIX; GRANT UNLIMITED TABLESPACE TO ZABBIX; GRANT SELECT ANY DICTIONARY TO ZABBIX;
** NOTE : f you are using Oracle ==g, you will need to add the following) 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 =>*');
$ou can verify the above is correct by running) select utl_inaddr.get_host_name(127.0.0.1) from dual; ?. 0or this example on 6ed#at, run) chkconfig -add orabbix L. +erify with) chkconfig -list
B. 5reate a #ost entry in Zabbix for the D( nstance&s you are planning to monitor, and import the templates found at) &opt&orabbix&template KK 7lease note, instructions for step ,B- can be found in the Zabbix Manual at http)&&www.'abbix.com&documentation.php /ith this step ,B-, ensure the name of your host in Zabbix is the same name of the 1 D or Oracle instance name.
"on!i#uration
4ow we need to configure your Orabbix setup. "he tags below are listed as they will appear within the respective configuration files. "he first you will need to modify is your config.props file to define your connection properties for Zabbix and Oracle. "he config.props file can be found at /opt/orabbix/conf/config.props
$abbix er%er&ist
'comma separed list o! $abbix ser%ers "he settings under this tag allow you to configure your Zabbix 1erver information. Orabbix can also be configured to send your Oracle data to multiple Zabbix servers. TIP: This can be beneficial for distributed monitoring scenarios, server migrations or Orabbix data to a Disaster Recovery site or server. 6eplace with your Zabbix 1erver info where appropriate9 ZabbixServer ist!ZabbixServer"#ZabbixServer$ ZabbixServer".A%%ress!"&$."'(.)." ZabbixServer".Port!"))*" ZabbixServer$.A%%ress!"&$."'(.).$ ZabbixServer$.Port!"))*" replicating
OrabbixDaemon
Entries under this tag allow you to set your Orabbix Daemon parameters. '(ax)hread*umber should be +, than the number o! your databases 1et the number of threads the Orabbix Daemon should have inside his internal pool of D( :obs. "his number should be at least e!ual to ,or more than- then number of databases monitored by Orabbix, now this parameter if not set is automatically calculated. e.g. 0or CH Databases, we are using =HH threads Orabbix+ae,on.MaxT-rea%N.,ber!")) 'pid-ile 4ext you can set the location of the Daemons 7 D file. Default location is) &opt&orabbix&logs Orabbix+ae,on.Pi%/i0e!./0ogs/orabbix.pi% KK 4O"E) 6elative path is permitted here
TIP: With the features of the Orabbix Daemon, it is possible to clone Orabbix and use different configurations. As such, it is therefore possible to have one Daemon that checks your T !T databases, another iteration that checks your D " #O$% &T databases and a third that checks your $ROD'(T)O& databases, each *ith different timings and check loops+
Database&ist
'put here your databases in a comma separated list "his is where you define your database instances. $ou can specify more than one instance here, separated using a comma. +atabase ist!E1AMP E"#E1AMP E$ KK 4ote) "he names of the instances must match those you have specified as your #O1" name in Zabbix '"on!i#uration o! "onnection pool 0rom here, you will configure settings that are specific to the connection pool. .s the comments in config.props suggest, if you do not specify these values, Orabbix will use default values which have been hard%coded. '(aximum number o! acti%e connection inside pool 1et the maximum number of connections that can be allocated to this pool at any time,or alternatively set a negative value for no limit. +atabase ist.MaxActive!") ')he maximum number o! milliseconds #ere you define how long that the pool will wait ,when there are no available connections- for a connection to be returned before throwing an exception, or set the value M< H to wait indefinitely. +atabase ist.Max2ait!")) .lso under the same section, you can define the maximum number of connections that can remain idle within the connection pool, without being released. .lternatively, you can set a negative value for no limit. +atabase ist.MaxI%0e!" TIP: ,ou can specify the Database connection parameters for each database you *ish to monitor individually, underneath your Database (onnection $arameters. This allo*s you to customise your connection settings based on the Database constraints ).e one connection pool for your $ROD'(T)O& D- and another for you T !T D-, for example. D-/.%axActive0/1 D-/.%axWait0/11 D-/.%ax)dle0/ &ote that any settings defines this *ay *ill override the general settings for your generic connection pool.
"his section sets your connection string to the Oracle Database. "his string invokes a :ava Database 5onnector ,:D(5- to your Oracle Databases, and as such does not need the Oracle 5lient to be installed. 'de!ine here your connection strin# !or each database #ere you will define the connection string. "hese are formatted as) D(4ame.Irl,as specified in your Database#ist- followed by the Adbc string and your Database 1erver information. E1AMP E./0rl02dbc3oracle3thin34! R" R/. 5A%$# .(O%3/67/3D-/ 1et your Database username and password below. e.g. E1AMP E".3ser!4abbix E1AMP E".Pass5or%!4abbix6pass5or% T)$3 !etting connections to multiple databases is made easy by adding more connection strings, *ith their corresponding credentials. xample given belo*.
E1AMP E$.3r0!7%bc:orac0e:t-in:8server$.%o,ain.exa,p0e.co,:9 ISTENER6PORT::E1AMP E$ E1AMP E$.3ser!4abbix E1AMP E$.Pass5or%!4abbix6pass5or% E1AMP E;.3r0!7%bc:orac0e:t-in:8server;.%o,ain.exa,p0e.co,:9 ISTENER6PORT::E1AMP E; E1AMP E;.3ser!4abbix E1AMP E;.Pass5or%!4abbix6pass5or%
KK 4ote) .fter these entries, you can set your Max.ctive, Max/ait and Max dle for the individual database connections if you so wish. "here is a pair of default parameter)
+efa.0t3ser ! 93SERNAME: +efa.0tPass5or% ! 9PASS2OR+:
adds another custom !uery to the default !uery file. f there are duplicates the Extra2uery3ist0ile will override them.
$ou can specify if you want a different execution period for your !uery c.sto,=.er>Ite,Na,e.Perio%!9Express a perio% in ,in.te: T)$3,ou can change the execution time of dbversion that don;t change often 4ext you can specify a !uery that will be executed and if return Race(ondiftion"alue the !uery custom<uery)tem&ame is executed otherwise is skipped c.sto,=.er>Ite,Na,e.AATIBE!Ctr.eDfa0seE if true !uery is executed otherwise skipped
arc-ive.=.er>!se0ect ro.n%F A. OGS*<.ABG/")$H/")$H/") I fro, F SE EAT AO3NT F*I OGS /ROM BJ OG6@ISTORK 2@ERE /IRST6TIME :! Fs>s%ate L")/')/$HII A# F SE EAT AvgF<KTESI ABG# Ao.ntF"I# MaxF<KTESI Max6<>tes#MinF<KTESI Min6<>tes /ROM vJ0ogI < arc-ive.RaceAon%ition=.er>!se0ect va0.e fro, vJpara,eter 5-ere na,e!M0og6arc-ive6startM arc-ive.RaceAon%itionBa0.e!/A SE T)$3 )n the example above, Orabbix *ould execute 8archive.<uery9 only if the =uery 8archive.Race(ondition<uery9 return the value 8archive.Race(ondition"alue9. $ratically the 8Archive9 =uery is execute only if database is in arhivelogmode >$arameter 8log?archive?start9 set to TR' @ 9=.er>Na,e:.Tri,!Ctr.eDfa0seE if true the resultset is trimmed >default is true@
9=.er>Na,e:.A%%Spaces!Ctr.eDfa0seE if true the add a space bet*een columns of resultset>default is true@ 9=.er>Na,e:.Exc0.%eAo0.,ns ist!C"#$#;#..nE exclude from result set the /st, the 7nd etc.. columns from resultset 9=.er>Na,e:.Perio% 9=3ERK6NAME:.2-enNotA0ive ! 9BA 3E: is used to specify a value or a string to send if a database is not *orking, doing such *ill AcleanA the graphs generated in :abbix *ith a AsetA value.
Added the following parameter on main configuration file: DefaultUser = <USERNAME> Default assword = < ASS!"RD> 9 =.er>Na,e :.Extra=.er> ist/i0e ! 9BA 3E:
on #uer$%s properties file &%'e added the following parameter: <(UER)*NAME>+!henNotAli'e = <,A-UE> with these parameter $ou can define a default username and password for all the data.ase+ DefaultUser = <USERNAME> Default assword = < ASS!"RD> this default parameter can .e o'erridden using the couple <D/*NAME>+User and <D/*NAME>+User &s possi.le to o'erride onl$ Username or assword+ the following parameter <D/*NAME>+E0tra(uer$-ist1ile = add another custom #uer$ to a default #uer$ file+ if there are duplicate the E0tra(uer$-ist1ile will o'erride them+ the following parameter <(UER)*NAME>+!henNotAli'e = <,A-UE> is used to specif$ a 'alue or a string to send if a data.ase is not wor2ing3 doing so $ou are going to 4clean4 the graphs generated in 5a..i0 with a 4set4 'alue+
"he property setting responsible for defining the output location is9 logB2.appender.Orabbix.Cile0logsDorabbix.log T)$3 Crom this properties file, you can modify the location, file name and log format as desired. Cor additional information, please refer to the official logB2 documentation, found at. http)&&logging.apache.org&logEA&=.G&index.html
&I"5*"5 In!ormation
Orabbix is released under and according to the 4*0 45*5RA& P06&I" &I"5* 5 7ersion 89 :; <une :==>