-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathAdd support for Zabbix 4.txt
114 lines (104 loc) · 9.37 KB
/
Add support for Zabbix 4.txt
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
Add support for Zabbix 4.txt
感谢504393421同学修改源码编译为orabbix-1.2.4.jar
orabbix日志:
2018-11-06 00:04:01,046 [main] DEBUG Orabbix - Waking up Goood Morning
2018-11-06 00:04:01,047 [main] ERROR Orabbix - QueryBox - 78
2018-11-06 00:04:01,047 [main] ERROR Orabbix - QueryBox - 80
2018-11-06 00:04:01,047 [main] DEBUG Orabbix - Loaded the properties from ./conf/query.props
2018-11-06 00:04:01,047 [main] DEBUG Orabbix - Note: hitratio_trigger.NoDataFound null or not present null
2018-11-06 00:04:01,047 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQuery null or not present null
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionValue null or not present null
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Note: hitratio_trigger.Period null or not present null
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Note: hitratio_trigger.ExcludeColumnsList error null
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQueryExcludeColumnsList error null
2018-11-06 00:04:01,048 [main] ERROR Orabbix - QueryBox - 86
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Loaded the properties from ./conf/query.props
2018-11-06 00:04:01,048 [main] DEBUG Orabbix - Note: hitratio_trigger.NoDataFound null or not present null
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQuery null or not present null
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionValue null or not present null
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Note: hitratio_trigger.Period null or not present null
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Note: hitratio_trigger.ExcludeColumnsList error null
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQueryExcludeColumnsList error null
2018-11-06 00:04:01,049 [main] ERROR Orabbix - querybox - 90
2018-11-06 00:04:01,049 [main] ERROR Orabbix - firstq==null : false
2018-11-06 00:04:01,049 [main] ERROR Orabbix - extraq==null : false
2018-11-06 00:04:01,049 [main] ERROR Orabbix - querybox - 96
2018-11-06 00:04:01,049 [main] DEBUG Orabbix - Ready to run DBJob for dbname ->orclpdb1
2018-11-06 00:04:01,050 [pool-1-thread-2] DEBUG Orabbix - Starting dbJob on database orclpdb1 QueryList
2018-11-06 00:04:01,052 [pool-1-thread-2] ERROR Orabbix - in Alive()
2018-11-06 00:04:01,052 [pool-1-thread-2] DEBUG Orabbix - sending ZBXDH<req><host>b3JjbHBkYjE=</host><key>YWxpdmU=</key><data>MQ==</data></req>
2018-11-06 00:04:01,054 [pool-1-thread-2] DEBUG Orabbix - received OK
2018-11-06 00:04:01,055 [pool-1-thread-2] DEBUG Orabbix - sending ZBXDp<req><host>b3JjbHBkYjE=</host><key>T3JhYmJpeC5WZXJzaW9u</key><data>T3JhYmJpeCBWZXJzaW9uIDEuMi4zIA==</data></req>
2018-11-06 00:04:01,056 [pool-1-thread-2] DEBUG Orabbix - received OK
2018-11-06 00:04:01,056 [pool-1-thread-2] INFO Orabbix - Done with dbJob on database orclpdb1 QueryList elapsed time 6 ms
2018-11-06 00:05:01,050 [main] DEBUG Orabbix - Waking up Goood Morning
2018-11-06 00:05:01,051 [main] ERROR Orabbix - QueryBox - 78
2018-11-06 00:05:01,051 [main] ERROR Orabbix - QueryBox - 80
2018-11-06 00:05:01,051 [main] DEBUG Orabbix - Loaded the properties from ./conf/query.props
2018-11-06 00:05:01,051 [main] DEBUG Orabbix - Note: hitratio_trigger.NoDataFound null or not present null
2018-11-06 00:05:01,051 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQuery null or not present null
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionValue null or not present null
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Note: hitratio_trigger.Period null or not present null
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Note: hitratio_trigger.ExcludeColumnsList error null
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQueryExcludeColumnsList error null
2018-11-06 00:05:01,052 [main] ERROR Orabbix - QueryBox - 86
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Loaded the properties from ./conf/query.props
2018-11-06 00:05:01,052 [main] DEBUG Orabbix - Note: hitratio_trigger.NoDataFound null or not present null
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQuery null or not present null
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionValue null or not present null
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Note: hitratio_trigger.Period null or not present null
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Note: hitratio_trigger.ExcludeColumnsList error null
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Note: hitratio_trigger.RaceConditionQueryExcludeColumnsList error null
2018-11-06 00:05:01,053 [main] ERROR Orabbix - querybox - 90
2018-11-06 00:05:01,053 [main] ERROR Orabbix - firstq==null : false
2018-11-06 00:05:01,053 [main] ERROR Orabbix - extraq==null : false
2018-11-06 00:05:01,053 [main] ERROR Orabbix - querybox - 96
2018-11-06 00:05:01,053 [main] DEBUG Orabbix - Ready to run DBJob for dbname ->orclpdb1
2018-11-06 00:05:01,054 [pool-1-thread-3] DEBUG Orabbix - Starting dbJob on database orclpdb1 QueryList
2018-11-06 00:05:01,056 [pool-1-thread-3] ERROR Orabbix - in Alive()
2018-11-06 00:05:01,056 [pool-1-thread-3] DEBUG Orabbix - Actual query is hitratio_triggerNextrun 2018/11/06 00:07:01 on database=orclpdb1 Period=2
2018-11-06 00:05:01,057 [pool-1-thread-3] DEBUG Orabbix - I'm going to return 64.83664387278845110170411375230652339086 for query hitratio_trigger on database=orclpdb1
2018-11-06 00:05:01,057 [pool-1-thread-3] DEBUG Orabbix - Item retrieved 1 on database orclpdb1
2018-11-06 00:05:01,058 [pool-1-thread-3] DEBUG Orabbix - dbname orclpdb1 sending item hitratio_trigger value 64.83664387278845110170411375230652339086
2018-11-06 00:05:01,058 [pool-1-thread-3] DEBUG Orabbix - sending ZBXDH<req><host>b3JjbHBkYjE=</host><key>YWxpdmU=</key><data>MQ==</data></req>
2018-11-06 00:05:01,060 [pool-1-thread-3] DEBUG Orabbix - received OK
2018-11-06 00:05:01,060 [pool-1-thread-3] DEBUG Orabbix - sending ZBXDp<req><host>b3JjbHBkYjE=</host><key>T3JhYmJpeC5WZXJzaW9u</key><data>T3JhYmJpeCBWZXJzaW9uIDEuMi4zIA==</data></req>
2018-11-06 00:05:01,061 [pool-1-thread-3] DEBUG Orabbix - received OK
2018-11-06 00:05:01,062 [pool-1-thread-3] DEBUG Orabbix - sending ZBXD�<req><host>b3JjbHBkYjE=</host><key>aGl0cmF0aW9fdHJpZ2dlcg==</key><data>NjQuODM2NjQzODcyNzg4NDUxMTAxNzA0MTEzNzUyMzA2NTIzMzkwODY=</data></req>
2018-11-06 00:05:31,093 [pool-1-thread-3] ERROR Orabbix - Error contacting Zabbix server 172.17.10.83 on port 10051
2018-11-06 00:05:31,093 [pool-1-thread-3] INFO Orabbix - Done with dbJob on database orclpdb1 QueryList elapsed time 30039 ms
zabbix server日志:
293:20181106:000531.093 Message from 172.18.0.1 is shorter than expected 12435439 bytes. Message ignored.
分析
监控项:hitratio_trigger
监控项类型:浮点数
sql为:select gethitratio*100 "get_pct" FROM v$librarycache where namespace ='TRIGGER'
sql值为:64.83664387278845110170411375230652339086
修改
sql为:select round(gethitratio*100,4) "get_pct" FROM v$librarycache where namespace ='TRIGGER'
====================================================================================================
有朋友提到公司的监控项超多,是否有这方面的限制,我的测试如下:
由于open_cursors默认值为300,所以监控项超过300个的话,需要修改oracle参数配置,
修改之后,运行正常,1000个监控正常
2018-11-17 15:07:08,104 [pool-1-thread-68] ERROR Orabbix - Error on DBEnquiry on query=hitratio_trigger0499 on database=orclcdb Error returned is java.lang.IllegalArgumentException: null value for key 'hitratio_trigger0499'
2018-11-17 15:07:08,105 [pool-1-thread-68] WARN Orabbix - Error while executing ->hitratio_trigger0500- on database ->orclcdb- Exception received ORA-00604: error occurred at recursive SQL level 1
ORA-01000: maximum open cursors exceeded
ORA-01000: maximum open cursors exceeded
处理:
show parameter open_cursors;
alter system set open_cursors=3000 scope=both;
当配置1w个时,报错如下:
2018-11-17 16:10:34,705 [pool-1-thread-4] ERROR Orabbix - Error on DBEnquiry on query=hitratio_trigger6011 on database=orclcdb Error returned is java.lang.IllegalArgumentException: null value for key 'hitratio_trigger6011'
2018-11-17 16:10:41,940 [pool-1-thread-13] INFO Orabbix - Done with dbJob on database orclpdb1 QueryList elapsed time 7380 ms
2018-11-17 16:10:43,304 [pool-1-thread-4] WARN Orabbix - Error while executing ->hitratio_trigger6140- on database ->orclcdb- Exception received ORA-04088: error during execution of trigger 'C##HD40.LOGON_DENIED_TO_ALERT'
ORA-00604: error occurred at recursive SQL level 2
ORA-04031: unable to allocate 12280 bytes of shared memory ("shared pool","select /*+ index(idl_ub1$ i_...","KKSSP^135","kglseshtSegs")
ORA-04031: unable to allocate 12280 bytes of shared memory ("shared pool","unknown object","KKSSP^135","kglseshtSegs")
处理:修改oracle参数配置,并强制重启oracle
create pfile='/opt/oracle/pfile_orclcdb_20181117.ora' from spfile;
alter system set open_cursors=30000 scope=both;
ALTER SYSTEM SET sga_target = 5000M SCOPE=spfile;
ALTER SYSTEM SET sga_max_size = 5000M SCOPE=spfile;
startup force;
之后1w个监控正常,只是获取一次数据非常慢,长达11分钟
2018-11-17 16:37:12,561 [pool-1-thread-2] INFO Orabbix - Done with dbJob on database orclcdb QueryList elapsed time 688001 ms