Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix Monitoring oracle 12c

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Zabbix Monitoring oracle 12c

Preface

A company needs to monitor Oracle 12C, using orabbix is a plug-in for zabbix to monitor oracle database, which can be monitored by modifying some places.

one。 Installation configuration

Mkdir / opt/orabbix

Cd / opt/orabbix

Mv conf/config.props.sample conf/config.props

Cp init.d/orabbix / etc/init.d/

Chmod + x / etc/init.d/orabbix

Chkconfig orabbix on

two。 Modify orabbix configuration

Note: red is the place to repair.

Vi conf/config.props

# comma separed list of Zabbix servers

ZabbixServerList=ZabbixServer

ZabbixServer.Address=0.0.0.0 # zabbix Monitoring IP

ZabbixServer.Port=10051 # zabbix Monitoring Port

# pidFile

OrabbixDaemon.PidFile=./logs/orabbix.pid

# frequency of item's refresh

OrabbixDaemon.Sleep=60

# MaxThreadNumber should be > = than the number ofyour databases

OrabbixDaemon.MaxThreadNumber=200

# put here your databases in a comma separated list

DatabaseList=10.78.136.18,10.78.207.22

# ORACALEIP address to be monitored, adopted and separated

# Configuration of Connection pool

# if not specified Orabbis is going to use defaultvalues (hardcoded)

# Maximum number of active connection inside pool

DatabaseList.MaxActive=10

# The maximum number of milliseconds that the poolwill wait

# (when there are no available connections) for aconnection to be returned

# before throwing an exception, or 'resolve.xml',description = >' resolve acl', principal = > 'ZABBIX',is_grant = > true, privilege = >' resolve')

Execdbms_network_acl_admin.assign_acl (acl= > 'resolve.xml', host = >' *')

Commit

three。 Create an ORACLE monitoring account

1. Log in to the ORACLE command line

Su- oracale

Sqlplus/ as sydba

Selectinstance_name from instance; # View instance

2. Create a user

CREATE USER ZABBIX

IDENTIFIED BY ZABBIX

DEFAULT TABLESPACE SYSTEM

TEMPORARY TABLESPACE TEMP

PROFILE DEFAULT

ACCOUNT UNLOCK

3. Give permissions to the role

GRANT CONNECT TO ZABBIX

GRANT RESOURCE TO ZABBIX

ALTER USER ZABBIX DEFAULT ROLEALL

4. Give permissions to the system

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

four。 Start

/ etc/init.d/orabbix start

5. Import template

Configuration-"template -" import

Click Import

VI. Configure the host

Note: the host name must be the same as the orabbix configuration

Click add-"Archive"

7. Add SQL query

Modify vi conf/query.props

DefaultQueryPeriod=2

QueryList=archive,audit,dbblockgets,dbconsistentgets,dbhitratio,dbphysicalread,dbversion,hitratio_body,hitratio_sqlarea,hitratio_table_proc,\

Lio_current_read,locks,maxprocs,maxsession,miss_latch,pga_aggregate_target,pga,phio_datafile_reads,phio_datafile_writes,phio_redo_writes,pinhitratio_body,pinhitratio_sqlarea,pinhitratio_table-proc,pinhitratio_trigger,\

Pool_dict_cache,pool_free_mem,pool_lib_cache,pool_misc,pool_sql_area,procnum,session_active,session_inactive,session,session_system,sga_buffer_cache,\

Sga_fixed,sga_java_pool,sga_large_pool,sga_log_buffer,sga_shared_pool,tbl_space,userconn,waits_controfileio,waits_directpath_read,\

Waits_file_io,waits_latch,waits_logwrite,waits_multiblock_read,waits_singleblock_read,hitratio_trigger,lio_block_changes,lio_consistent_read,waits_other,waits_sqlnet,users_locked,uptime,config_session,connect_session,active_session,Lactch_Enq_Event,User_IO,System_IO,Administrative,Scheduler,Configuration,Rac,Application,Queueing,Network,Commit,Idle,dbfilesize,dbsize

DataGuardPrimaryQueryList=dg_error,dg_sequence_number

DataGuardStandbyQueryList=dg_sequence_number_stby

RmanQueryList=rman_check_status

Rman_check_status.Query=select 'DBNAME- >' | | DB_NAME | |'- ROW TYPE- >'| | ROW_TYPE | |'- STARTTIME- >'| | to_char (start_time,'Dy DD-Mon-YYYY HH24:MI:SS') | |'- ENDTIME- >'| | to_char (end_time) 'Dy DD-Mon-YYYY HH24:MI:SS') | |'-MBYTESPROCESSED- >'| | MBYTES_PROCESSED | |'- OBJECT TYPE- >'| | OBJECT_TYPE | |'- STATUS- >'| | STATUS | |'- OUTPUT DEVICE- >'| | OUTPUT_DEVICE_TYPE | |'- INPUTMB- >'| | INPUT_BYTES/1048576 | |'- OUT MB' | | OUTPUT_BYTES/1048576\

FROM rc_rman_status\

WHERE start_time > SYSDATE-1\

AND (STATUS like'% FAILED%'\

OR STATUS like'% ERROR%')\

ORDER BY END_TIME

Rman_check_status.NoDataFound=none

Uptime.Query=selectto_char ((sysdate-startup_time) * 86400, 'FM99999999999999990') retvalue fromv$instance

Users_locked.Query=SELECT username | |'| | lock_date | |'| | account_status FROM dba_users where ACCOUNT_STATUS like'EXPIRED (GRACE)'or ACCOUNT_STATUS like' LOCKED (TIMED)'

Users_locked.NoDataFound=none

Archive.Query=selectround (A.LOGS*B.AVG/1024/1024/10) from (SELECT COUNT (*) LOGS FROM V$LOG_HISTORY WHERE FIRST_TIME > = (sysdate-10-60-24)) A, (SELECT Avg (BYTES) AVG, Count (1), Max (BYTES) Max_Bytes, Min (BYTES) Min_Bytes FROM v$log) B

Archive.RaceConditionQuery=select valuefrom v$parameter where name='log_archive_start'

Archive.RaceConditionValue=FALSE

Audit.Query=select username "username",\

To_char (timestamp,'DD-MON-YYYYHH24:MI:SS') "time_stamp",\

Action_name "statement",\

Os_username "os_username",\

Userhost "userhost",\

Returncode | | decode (returncode,'1004','-WrongConnection','1005','-NULL Password','1017','-WrongPassword','1045','-Insufficient Priviledge','0','-Login Accepted','--') "returncode"\

Fromsys.dba_audit_session\

Where (sysdate-timestamp) * 24

< 1 and returncode 0 \ orderby timestamp audit.NoDataFound=none dbblockgets.Query=selectto_char(sum(decode(name,'db block gets', value,0))) "block_gets" \ FROMv$sysstat dbconsistentgets.Query=selectto_char(sum(decode(name,'consistent gets', value,0)))"consistent_gets" \ FROMv$sysstat dbhitratio.Query=select ( \ sum(decode(name,'consistentgets', value,0)) + sum(decode(name,'db block gets', value,0)) -sum(decode(name,'physical reads', value,0))) / (sum(decode(name,'consistentgets', value,0)) + sum(decode(name,'db block gets', value,0)) ) * 100"hit_ratio" \ FROMv$sysstat dbphysicalread.Query=selectsum(decode(name,'physical reads', value,0)) "phys_reads" FROMv$sysstat dbversion.Query=select COMP_ID||''||COMP_NAME||' '||VERSION||' '||STATUS||' ' from dba_registryunion SELECT ' - SERVERNAME = '||UTL_INADDR.get_host_name||' - SERVERADDRESS ='||UTL_INADDR.get_host_address||' 'from dualunion SELECT ' - DB_NAME = '||SYS_CONTEXT ('USERENV', 'DB_NAME')||' - INSTANCE_NAME = ' ||SYS_CONTEXT ('USERENV','INSTANCE_NAME')||' ' FROM dual sqlnotindexed.Query=SELECT SUM(DECODE(NAME,'table scans (long tables)', VALUE, 0))/ (SUM(DECODE(NAME, 'table scans (longtables)', VALUE, 0))+SUM(DECODE(NAME, 'table scans (short tables)', VALUE,0)))*100 SQL_NOT_INDEXED FROM V$SYSSTAT WHERE 1=1 AND ( NAME IN ('table scans(long tables)','table scans (short tables)') ) hitratio_body.Query=select gethitratio*100"get_pct" FROM v$librarycache where namespace ='BODY' hitratio_sqlarea.Query=selectgethitratio*100 "get_pct" FROM v$librarycache where namespace ='SQLAREA' hitratio_trigger.Query=selectgethitratio*100 "get_pct" FROM v$librarycache where namespace='TRIGGER' hitratio_table_proc.Query=selectgethitratio*100 "get_pct" FROM v$librarycache where namespace ='TABLE/PROCEDURE' lio_block_changes.Query=SELECTto_char(SUM(DECODE(NAME,'db block changes',VALUE,0))) \ FROM V$SYSSTAT \ WHERE NAME ='db block changes' lio_consistent_read.Query=SELECTto_char(sum(decode(name,'consistent gets',value,0))) FROM V$SYSSTAT WHERE NAME='consistent gets' lio_current_read.Query=SELECTto_char(sum(decode(name,'db block gets',value,0))) FROM V$SYSSTAT WHERE NAME='db block gets' locks.Query=SELECT b.session_id AS sid, \ NVL(b.oracle_username, '(oracle)') AS username, \ a.owner AS object_owner, \ a.object_name, \ Decode(b.locked_mode, 0, 'None', \ 1, 'Null (NULL)', \ 2, 'Row-S (SS)', \ 3, 'Row-X (SX)', \ 4, 'Share (S)', \ 5, 'S/Row-X(SSX)', \ 6, 'Exclusive(X)', \ b.locked_mode)locked_mode, \ b.os_user_name \ FROM dba_objects a, \ v$locked_object b \ WHERE a.object_id = b.object_id \ ORDER BY 1, 2, 3, 4 #locks.Query=select sn.USERNAME ||'@'||sn.machine, \ '|SID->

'| | m.SID,\ |

'| Serial- >' | | sn.SERIAL#,\

'| LockType- >' | | m.TYPE,\ |

Decode (LMODE,\

1Magnesia Nullhorse,\

2. Mr. Rowmurs (SS)',\

3Perfect Rowhouse X (SX)',\

4. "SharePoint",\

5Magnum Splink RowmurX (SSX)',\

6 lock_type exclusive'),\

Decode (REQUEST,\

07.0mm Noneware,\

1Magnesia Nullhorse,\

2. Mr. Rowmurs (SS)',\

3Perfect Rowhouse X (SX)',\

4, 'Share',\

5Magnum Splink RowmurX (SSX)',\

6 lock_requested exclusive'),\

'| Time (Sec)->' | | m.CTIME "Time (sec)",\

'| ID1- >' | | m.ID1,\ |

'| ID2- >' | | m.ID2,\ |

'| SQLText- >' | | t.SQL_TEXT\

From v$sessionsn,\

V$lockm,\

V$sqltextt\

Where t.ADDRESS=sn.SQL_ADDRESS\

And t.HASH_VALUE=sn.SQL_HASH_VALUE\

And ((sn.SID=m.SID and m.REQUEST! = 0)\

Or (sn.SID=m.SID and m.REQUEST = 0 and LMODE! = 4 and (ID1, ID2) in\

(select s.ID1, s.ID2\

From v$lock S\

Where REQUEST! = 0\

And s.ctime > 5\

And s.ID1 = m.ID1\

And s.ID2 = m.ID2)\

Order by sn.USERNAME, sn.SID, t.PIECE

Locks.NoDataFound=none

Maxprocs.Query=select value "maxprocs" from v$parameter where name = 'processes'

Maxsession.Query=select value "maxsess" from v$parameter where name = 'sessions'

Miss_latch.Query=SELECT SUM (misses) FROMV$LATCH

Pga_aggregate_target.Query=selectto_char (decode (unit,'bytes', value/1024/1024, value), '999999999.9') value fromV$PGASTAT where name in 'aggregate PGA target parameter'

Pga.Query=select to_char (decode (unit,'bytes', value/1024/1024, value), '999999999.9') value from V$PGASTAT wherename in 'total PGA inuse'

Phio_datafile_reads.Query=selectto_char (sum (decode (name,'physical reads direct',value,0) FROM V$SYSSTAT wherename = 'physical reads direct'

Phio_datafile_writes.Query=selectto_char (sum (decode (name,'physical writes direct',value,0) FROM V$SYSSTATwhere name = 'physical writes direct'

Phio_redo_writes.Query=select to_char (sum (decode (name,'redowrites',value,0) FROM V$SYSSTAT where name = 'redowrites'

Pinhitratio_body.Query=selectpins/ (pins+reloads) * 100 "pin_hit ratio" FROM v$librarycache wherenamespace = 'BODY'

Pinhitratio_sqlarea.Query=selectpins/ (pins+reloads) * 100 "pin_hit ratio" FROM v$librarycache wherenamespace = 'SQL AREA'

Pinhitratio_table-proc.Query=selectpins/ (pins+reloads) * 100 "pin_hit ratio" FROM v$librarycache wherenamespace = 'TABLE/PROCEDURE'

Pinhitratio_trigger.Query=selectpins/ (pins+reloads) * 100 "pin_hit ratio" FROM v$librarycache wherenamespace = 'TRIGGER'

Pool_dict_cache.Query=SELECTTO_CHAR (ROUND (SUM (decode (pool,'shared pool',decode (name,'dictionarycache', (bytes) / (1024-1024), 0), 2)) pool_dict_cache FROM V$SGASTAT

Pool_free_mem.Query=SELECT TO_CHAR (ROUND (SUM (decode (pool,'sharedpool',decode (name,'free memory', (bytes) / (1024-1024), 0), 2)) pool_free_memFROM V$SGASTAT

Pool_lib_cache.Query=SELECTTO_CHAR (ROUND (SUM (decode (pool,'shared pool',decode (name,'librarycache', (bytes) / (1024-1024), 0), 2)) pool_lib_cache FROM V$SGASTAT

Pool_misc.Query=SELECTTO_CHAR (ROUND (SUM (decode (pool,'shared pool',decode (name,'librarycache',0,'dictionary cache',0,'free memory',0,'sql area',0, (bytes) / (1024-1024)), 0)), 2) pool_misc FROM V$SGASTAT

Pool_sql_area.Query=SELECT TO_CHAR (ROUND (SUM (decode (pool,'sharedpool',decode (name,'sql area', (bytes) / (1024-1024), 0), 2)) pool_sql_area FROMV$SGASTAT

Procnum.Query=select count (*) "procnum" from v$process

Session_active.Query=select count (*) fromv$session where TYPERIMETHER BACKGROUND' and status='ACTIVE'

Session_inactive.Query=selectSUM (Decode (Type, 'BACKGROUND', 0, Decode (Status,' ACTIVE', 0,1)) FROMV$SESSION

Session.Query=select count (*) fromv$session

Session_system.Query=selectSUM (Decode (Type, 'BACKGROUND', 1,0)) system_sessions FROM V$SESSION

Sga_buffer_cache.Query=SELECTto_char (ROUND (decode (pool,NULL,decode (name,'db_block_buffers', (bytes) / (1024 / 1024), 'buffer_cache', (bytes) / (1024 / 1024), 0), 2)) sga_bufcache FROM V$SGASTAT

Sga_fixed.Query=SELECT TO_CHAR (ROUND (SUM (decode (pool,NULL,decode (name,'fixed_sga', (bytes) / (1024-1024), 0), 2)) sga_fixed FROM V$SGASTAT

Sga_java_pool.Query=SELECTto_char (ROUND (SUM (decode (pool,'java pool', (bytes) / (1024 / 1024), 0), 2)) sga_jpoolFROM V$SGASTAT

Sga_large_pool.Query=SELECTto_char (ROUND (SUM (decode (pool,'large pool', (bytes) / (1024 / 1024), 0), 2)) sga_lpool FROM V$SGASTAT

Sga_log_buffer.Query=SELECTTO_CHAR (ROUND (SUM (decode (pool,NULL,decode (name,'log_buffer', (bytes) / (1024-1024), 0), 2)) sga_lbuffer FROM V$SGASTAT

Sga_shared_pool.Query=SELECTTO_CHAR (ROUND (SUM (decode (pool,'shared pool',decode (name,'librarycache',0,'dictionary cache',0,'free memory',0,'sqlarea',0, (bytes) / (1024-1024)), 0)), 2) pool_misc FROM V$SGASTAT

Tbl_space.Query=SELECT * FROM (\

Select'- Tablespace- >', t.tablespace_name ktablespace,\

'- Type- >', substr (t.contents, 1,1) tipo,\

'- Used (MB)->', trunc ((d.tbs_size-nvl (s.free_space, 0)) / 1024 take 1024) ktbs_em_uso,\

'- ActualSize (MB)->', trunc (d.tbs_size/1024/1024) ktbs_size,\

'- MaxSize (MB)->', trunc (d.tbs_maxsize/1024/1024) ktbs_maxsize,\

'- FreeSpace (MB)->', trunc (nvl (s.free_space, 0) / 1024Univer 1024) kfree_space,\

'- Space- >', trunc ((d.tbs_maxsize-d.tbs_size + nvl (s. Freecards space0)) / 1024 Universe 1024) kspace,\

'- Perc- >', decode (d.tbs_maxsize, 0,0 s.free_space trunc ((d.tbs_size-nvl (s.free_space, 0)) * 100/d.tbs_maxsize) kperc\

From\

(select SUM (bytes) tbs_size,\

SUM (decode (sign (maxbytes-bytes),-1, bytes, maxbytes) tbs_maxsize,tablespace_name tablespace\

From (select nvl (bytes, 0) bytes, nvl (maxbytes, 0) maxbytes,tablespace_name\

From dba_data_files\

Union all\

Select nvl (bytes, 0) bytes, nvl (maxbytes, 0) maxbytes, tablespace_name\

From dba_temp_files\

)\

Group by tablespace_name\

) d,\

(select SUM (bytes) free_space,\

Tablespace_name tablespace\

From dba_free_space\

Group by tablespace_name\

) s,\

Dba_tablespaces t\

Where t.tablespace_name = d.tablespace (+) and\

T.tablespace_name = s.tablespace (+)\

Order by 8)\

Where kperc > 93\

And tipo'T'\

And tipo'U'

Tbl_space.NoDataFound=none

Userconn.Query=select count (username) fromv$session where username is not null

Waits_controfileio.Query=SELECTto_char (sum (decode (event,'control file sequential read', total_waits, 'controlfile single write',total_waits,' controlfile parallel write',total_waits,0)) ControlFileIO FROM V$system_event WHERE 1, 1 AND event not in ('SQL*Net messagefrom client',' SQL*Net more data from client','pmon timer',' rdbms ipcmessage', 'rdbms ipc reply',' smon timer')

Waits_directpath_read.Query=SELECTto_char (sum (decode (event,'direct path read',total_waits,0) DirectPathReadFROM V$system_event WHERE 1, 1 AND event not in ('SQL*Net message from', 'SQL*Net more datafrom client','pmon timer',' rdbms ipc message', 'rdbms ipc reply',' smontimer')

Waits_file_io.Query=SELECTto_char (sum (decode (event,'file identify',total_waits, 'fileopen',total_waits,0)) FileIO FROM V$system_event WHERE 1x 1 AND event not in (' SQL*Net message from client', 'SQL*Net more data from client',' pmontimer', 'rdbms ipc message',' rdbms ipc reply', 'smon timer')

Waits_latch.Query=SELECTto_char (sum (decode (event,'control file sequential read', total_waits,\)

'control file single write',total_waits,' control file parallel write',total_waits,0) ControlFileIO\

FROM V$system_event WHERE 1 # 1 AND event notin (\

'SQL*Net message from client',\

'SQL*Net more data from client',\

'pmon timer', 'rdbms ipc message',\

'rdbms ipc reply',' smon timer')

Waits_logwrite.Query=SELECTto_char (sum (decode (event,'log file single write',total_waits, 'log fileparallel write',total_waits,0)) LogWrite\

FROM V$system_event WHERE 1 # 1 AND event notin (\

'SQL*Net message from client',\

'SQL*Net more data from client',\

'pmon timer', 'rdbms ipc message',\

'rdbms ipc reply',' smon timer')

Waits_multiblock_read.Query=SELECTto_char (sum (decode (event,'db file scattered read',total_waits,0) MultiBlockRead\

FROM V$system_event WHERE 1 # 1 AND event notin (\

'SQL*Net message from client',\

'SQL*Net more data from client',\

'pmon timer', 'rdbms ipc message',\

'rdbms ipc reply',' smon timer')

Waits_other.Query=SELECTto_char (sum (decode (event,'control file sequential read',0,'control file singlewrite',0,'control file parallel write',0,'db file sequential read',0,'db filescattered read',0,'direct path read',0,'file identify',0,'file open',0,'SQL*Netmessage toclient',0,'SQL*Net message to dblink',0, 'SQL*Net more data toclient',0,'SQL*Net more data to dblink',0) 'SQL*Net break/reset toclient',0,'SQL*Net break/reset to dblink',0,' logfile single write',0,'logfile parallel write',0,total_waits)) Other FROM V$system_event WHERE 1, 1 ANDevent not in ('SQL*Net message fromclient',' SQL*Net more data fromclient', 'pmon timer',' rdbms ipcmessage', 'rdbms ipc reply',' smontimer')

Waits_singleblock_read.Query=SELECTto_char (sum (decode (event,'db file sequential read',total_waits,0) SingleBlockRead\

FROM V$system_event WHERE 1 # 1 AND event notin (\

'SQL*Net message from client',\

'SQL*Net more data from client',\

'pmon timer', 'rdbms ipc message',\

'rdbms ipc reply',' smon timer')

Waits_sqlnet.Query=SELECTto_char (sum (decode (event,'SQL*Net message toclient',total_waits,'SQL* Netmessage todblink',total_waits, 'SQL*Net more data toclient',total_waits,'SQL*Net more data todblink',total_waits,' SQL*Netbreak/reset toclient',total_waits,'SQL*Net break/reset todblink',total_waits,0)) SQLNET FROM V$system_event WHERE 1 # 1\

AND event not in ('SQL*Net message fromclient','SQL*Net more data fromclient',' pmon timer','rdbms ipc message','rdbmsipc reply',' smon timer')

Dg_error.Query=SELECT ERROR_CODE, SEVERITY,MESSAGE, TO_CHAR (TIMESTAMP, 'DD-MON-RR HH24:MI:SS') TIMESTAMP FROMV$DATAGUARD_STATUS WHERE CALLOUT='YES' AND TIMESTAMP > SYSDATE-1

Dg_error.NoDataFound=none

Dg_sequence_number.Query=SELECT MAX (sequence#) FROM v$log_history

# dg_sequence_number_stby.Query=SELECT MAX (sequence#) last_log_applied FROM v$log_history

Dg_sequence_number_stby.Query= selectmax (sequence#) from v$archived_log

Config_session.Query=select valueconfig_session from v$parameter where name='sessions'

Connect_session.Query=select count (*) connect_session from v$session where username is not null

Active_session.Query=select count (*) active_session from v$session where username is not null and status='ACTIVE'

Lactch_Enq_Event.Query=select count (*) Latch_Enq_Event from v$session wherewait_class in ('Concurrency','Other') and username is not null

User_IO.Query=select count (*) User_IO from v$session where wait_class = 'User I/O'and username is not null

System_IO.Query=select count (*) System_IO from v$session wherewait_class = 'System I take O' and username is not null

Administrative.Query=select count (*) Administrative from v$session wherewait_class = 'Administrative' and username is not null

Scheduler.Query=select count (*) Scheduler from v$session where wait_class='Scheduler' and username is not null

Configuration.Query=select count (*) Configuration from v$session wherewait_class = 'Configuration' and username is not null

Rac.Query=select count (*) Rac from v$session where wait_class = 'Cluster'and username is not null

Application.Query=select count (*) Application from v$session wherewait_class = 'Application' and username is not null

Queueing.Query=select count (*) Queueing from v$session where wait_class='Queueing' and username is not null

Network.Query=select count (*) Network from v$session where wait_class='Network' and username is not null

Commit.Query=select count (*) Commit from v$session where wait_class = 'Commit' andusername is not null

Idle.Query=select count (*) Idle from v$session where wait_class = 'Idle' andusername is not null and event not in (' SQL*Net message from client')

Dbfilesize.Query=selectto_char (sum (bytes/1024/1024/1024), 'FM99999999999999990') retvalue fromdba_data_files

Dbsize.Query=SELECTto_char (sum (NVL (a.bytes/1024/1024/1024-NVL (f.bytes/1024/1024/1024, 0), 0)), 'FM99999999999999990') retvalue\

FROM sys.dba_tablespacesd,\

(select tablespace_name,sum (bytes) bytes from dba_data_files group by tablespace_name) a,\

(select tablespace_name,sum (bytes) bytes from dba_free_space group by tablespace_name) f\

WHERE d.tablespace_name = a.tablespace_name (+) AND d.tablespace_name = f.tablespace_name (+)\

AND NOT (d.extent_management like 'LOCAL' AND d.contents like' TEMPORARY')

Find QueryList= above and add dbfilesize.

Add query SQL statement at the bottom

Format such as dbfilesize.Query=

Add dbfilesize to the template

Template-"find the image above -" Click the project-"create a monitoring item

The name can be taken by yourself, and the type must be zabbix trap. The key value is the same as adding dbfilesize to conf/query.props 's QueryList=.

8. Create a map

Configuration-"filter -" create screen

Click change to add that kind of project.

The final picture is as follows

Attachment: http://down.51cto.com/data/2367269

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report