forked from ikzelf/zbxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
asm.19.cfg
83 lines (81 loc) · 3.87 KB
/
asm.19.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# vim: syntax=sql
[auto_discovery_60]
minutes: 60
dgrp.lld: select name "{#DGRP}" from v$asm_diskgroup
inst.lld: select distinct(inst_name) "{#INST_NAME}"
from (select rtrim(substr(regexp_replace(inst_name, '[^[:print:]]', ''), instr(inst_name, ':')+1)) inst_name from v$active_instances
union
select instance_name from gv$instance)
acfs.lld: select distinct volume_name "{#ASMVOL}" from v$asm_volume
parm.lld: select i.instance_name "{#INST_NAME}", p.name "{#PARAMETER}"
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
[startup]
minutes: 0
version: select 'inst[' | |instance_name | |',version]', version from v$instance
[checks_01m]
minutes: 1
inst.uptime: select 'inst[' | |instance_name | |',uptime]' key, (sysdate - startup_time)*60*60*24 val from gv$instance
disks.cached: select 'disks[count]', count(*) from v$asm_disk
union all
select 'disks[cached]', count(*) from v$asm_disk where mount_status = 'CACHED'
sysstat: select 'inst[' | |i.instance_name | |',' | |s.name | |']', s.value
from (
select inst_id, name, value from gv$sysstat
where name in ('execute count', 'DB time', 'user calls')
union all
select inst_id, 'processes' item, count(*) cnt
from gv$process
group by inst_id
union all
select inst_id, 'sessions', count(*)
from gv$session
group by inst_id
) s,
gv$instance i
where i.inst_id = s.inst_id
[checks_05m]
minutes: 5
dgrp.used: select 'dgrp[' | |name | |',filesize]' key, total_mb value from v$asm_diskgroup
union all
select 'dgrp[' | |name | |',usedbytes]' key, total_mb - USABLE_FILE_MB value from v$asm_diskgroup
union all
select 'dgrp[' | |name | |',pctfree]' key, ((case when USABLE_FILE_MB < 0 then 0 else USABLE_FILE_MB end) / total_mb)*100 value from v$asm_diskgroup
parm.val: select 'parm[' | |i.instance_name | |',' | |p.name | |',value]' key, p.value
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
and upper(p.description) not like '%SIZE%'
union all
select 'parm[' | |i.instance_name | |',' | |p.name | |',size]' key, p.value
from gv$instance i, gv$parameter p
where i.instance_number = p.inst_id
and p.type in (3, 6) and p.isdefault = 'FALSE'
and upper(p.description) like '%SIZE%'
acfs: select 'acfs[' | |volume_name | |',' | |
case when k = 1 then 'total_mb]'
when k = 2 then 'used_mb]'
when k = 3 then 'pct_free]'
end key
, case when k = 1 then to_char(round(total_mb))
when k = 2 then to_char(round(total_mb - free_mb))
-- when k = 3 then to_char(round(free_mb/total_mb*100))
when k = 3 then to_char((free_mb/total_mb*100))
end val
from (
SELECT v.volume_name, sum(acfs.total_mb) total_mb, sum(acfs.free_mb) free_mb
FROM V$ASM_DISKGROUP dg
, V$ASM_VOLUME v
, V$ASM_ACFSVOLUMES acfs
WHERE dg.group_number = v.group_number
and v.volume_device = acfs.vol_device
group by v.volume_name
)
cross JOIN ( SELECT LEVEL k FROM dual CONNECT BY LEVEL <= 3 ) k
[checks_60m]
minutes: 60
alertlog: select 'inst['||i.instance_name||',log]', d.value||'/alert_'||i.instance_name||'.log' from gv$instance i, gv$diag_info d
where i.inst_id = d.inst_id and d.name = 'Diag Trace'
instname: select 'zbxdb[connect,instance_name]', instance_name from v$instance
fullversion: select 'full_version', banner from v$version where banner like 'Oracle Database%'