码迷,mamicode.com
首页 > 其他好文 > 详细

Zabbix监控记录

时间:2019-02-10 20:26:28      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:close   kthread   需要   javap   idt   security   bsp   highlight   超时   

 一 Tomcat监控

1.1.1 Tomcat 端配置 JMX

    编辑catalina.sh文件,配置如下:

CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote                      # 启用远程监控JMX
-Dcom.sun.management.jmxremote.port=12345           # 默认启动的JMX端口号,要和zabbix添加主机的端口一致
-Dcom.sun.management.jmxremote.authenticate=false   # 不使用用户名密码认证
-Dcom.sun.management.jmxremote.ssl=false            # 不适用ssl认证
-Djava.rmi.server.hostname=172.16.0.20"             # tomcat主机地址

    重启Tomcat

/usr/local/tomcat/bin/shutdown.sh 
/usr/local/tomcat/bin/startup.sh 
~]# ss -lnt
State      Recv-Q Send-Q                                        Local Address:Port                                                       Peer Address:Port              
LISTEN     0      50                                                       :::12345                                                                :::*                  
                         

1.1.2 编译zabbix server,加入对java支持

    默认情况下,zabbix server 是没有加入java支持,所以要让zabbix监控tomcat,就需要开启zabbix监控java的专用服务zabbix-java-gateway.

yum install -y  java  java-devel  zabbix-java-gateway

  编辑zabbix-java-gateway配置文件

~]# grep ^[a-Z] /etc/zabbix/zabbix_java_gateway.conf 
LISTEN_IP="0.0.0.0"                                          # 监听地址
LISTEN_PORT=10052                                         # 监听端口
PID_FILE="/var/run/zabbix/zabbix_java.pid"        # pid文件
START_POLLERS=20                                           # 启动多少线程轮训java,要和java应用保持一定短息 
TIMEOUT=30                                                      # 超时时间                                                  

  配置zabbix server调用java gateway

~]# grep ^[a-Z] /etc/zabbix/zabbix_server.conf 
JavaGateway=172.16.0.88                  # 指定java gateway的地址            
JavaGatewayPort=10052                     # 指定java gateway的服务器监听端口,如果是默认端口可不写
StartJavaPollers=20                             # 轮训
Timeout=30              # 超时时间

1.1.3 图形化配置

    导入模板

技术图片
  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <zabbix_export>
  3     <version>3.0</version>
  4     <date>2018-06-26T13:09:54Z</date>
  5     <groups>
  6         <group>
  7             <name>Templates</name>
  8         </group>
  9     </groups>
 10     <templates>
 11         <template>
 12             <template>Tomcat JMX</template>
 13             <name>Tomcat JMX</name>
 14             <description/>
 15             <groups>
 16                 <group>
 17                     <name>Templates</name>
 18                 </group>
 19             </groups>
 20             <applications>
 21                 <application>
 22                     <name>class</name>
 23                 </application>
 24                 <application>
 25                     <name>HeapStatistics</name>
 26                 </application>
 27                 <application>
 28                     <name>Sessions</name>
 29                 </application>
 30                 <application>
 31                     <name>ThreadStatistics</name>
 32                 </application>
 33                 <application>
 34                     <name>Tomcat</name>
 35                 </application>
 36             </applications>
 37             <items>
 38                 <item>
 39                     <name>Sessions-当前活动会话数</name>
 40                     <type>16</type>
 41                     <snmp_community/>
 42                     <multiplier>0</multiplier>
 43                     <snmp_oid/>
 44                     <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,activeSessions]</key>
 45                     <delay>30</delay>
 46                     <history>90</history>
 47                     <trends>365</trends>
 48                     <status>0</status>
 49                     <value_type>3</value_type>
 50                     <allowed_hosts/>
 51                     <units/>
 52                     <delta>0</delta>
 53                     <snmpv3_contextname/>
 54                     <snmpv3_securityname/>
 55                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
 56                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
 57                     <snmpv3_authpassphrase/>
 58                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
 59                     <snmpv3_privpassphrase/>
 60                     <formula>1</formula>
 61                     <delay_flex/>
 62                     <params/>
 63                     <ipmi_sensor/>
 64                     <data_type>0</data_type>
 65                     <authtype>0</authtype>
 66                     <username/>
 67                     <password/>
 68                     <publickey/>
 69                     <privatekey/>
 70                     <port/>
 71                     <description/>
 72                     <inventory_link>0</inventory_link>
 73                     <applications>
 74                         <application>
 75                             <name>Sessions</name>
 76                         </application>
 77                     </applications>
 78                     <valuemap/>
 79                     <logtimefmt/>
 80                 </item>
 81                 <item>
 82                     <name>Sessions-The maximum number of active Sessions allowed, or -1 for no limit</name>
 83                     <type>16</type>
 84                     <snmp_community/>
 85                     <multiplier>0</multiplier>
 86                     <snmp_oid/>
 87                     <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,maxActiveSessions]</key>
 88                     <delay>30</delay>
 89                     <history>90</history>
 90                     <trends>365</trends>
 91                     <status>0</status>
 92                     <value_type>0</value_type>
 93                     <allowed_hosts/>
 94                     <units/>
 95                     <delta>0</delta>
 96                     <snmpv3_contextname/>
 97                     <snmpv3_securityname/>
 98                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
 99                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
100                     <snmpv3_authpassphrase/>
101                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
102                     <snmpv3_privpassphrase/>
103                     <formula>1</formula>
104                     <delay_flex/>
105                     <params/>
106                     <ipmi_sensor/>
107                     <data_type>0</data_type>
108                     <authtype>0</authtype>
109                     <username/>
110                     <password/>
111                     <publickey/>
112                     <privatekey/>
113                     <port/>
114                     <description/>
115                     <inventory_link>0</inventory_link>
116                     <applications>
117                         <application>
118                             <name>Sessions</name>
119                         </application>
120                     </applications>
121                     <valuemap/>
122                     <logtimefmt/>
123                 </item>
124                 <item>
125                     <name>Sessions-最大活动会话数</name>
126                     <type>16</type>
127                     <snmp_community/>
128                     <multiplier>0</multiplier>
129                     <snmp_oid/>
130                     <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,maxActive]</key>
131                     <delay>30</delay>
132                     <history>90</history>
133                     <trends>365</trends>
134                     <status>0</status>
135                     <value_type>3</value_type>
136                     <allowed_hosts/>
137                     <units/>
138                     <delta>0</delta>
139                     <snmpv3_contextname/>
140                     <snmpv3_securityname/>
141                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
142                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
143                     <snmpv3_authpassphrase/>
144                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
145                     <snmpv3_privpassphrase/>
146                     <formula>1</formula>
147                     <delay_flex/>
148                     <params/>
149                     <ipmi_sensor/>
150                     <data_type>0</data_type>
151                     <authtype>0</authtype>
152                     <username/>
153                     <password/>
154                     <publickey/>
155                     <privatekey/>
156                     <port/>
157                     <description/>
158                     <inventory_link>0</inventory_link>
159                     <applications>
160                         <application>
161                             <name>Sessions</name>
162                         </application>
163                     </applications>
164                     <valuemap/>
165                     <logtimefmt/>
166                 </item>
167                 <item>
168                     <name>Sessions-Number of sessions we rejected due to maxActive beeing reached</name>
169                     <type>16</type>
170                     <snmp_community/>
171                     <multiplier>0</multiplier>
172                     <snmp_oid/>
173                     <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,rejectedSessions]</key>
174                     <delay>30</delay>
175                     <history>90</history>
176                     <trends>365</trends>
177                     <status>0</status>
178                     <value_type>3</value_type>
179                     <allowed_hosts/>
180                     <units/>
181                     <delta>0</delta>
182                     <snmpv3_contextname/>
183                     <snmpv3_securityname/>
184                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
185                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
186                     <snmpv3_authpassphrase/>
187                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
188                     <snmpv3_privpassphrase/>
189                     <formula>1</formula>
190                     <delay_flex/>
191                     <params/>
192                     <ipmi_sensor/>
193                     <data_type>0</data_type>
194                     <authtype>0</authtype>
195                     <username/>
196                     <password/>
197                     <publickey/>
198                     <privatekey/>
199                     <port/>
200                     <description/>
201                     <inventory_link>0</inventory_link>
202                     <applications>
203                         <application>
204                             <name>Sessions</name>
205                         </application>
206                     </applications>
207                     <valuemap/>
208                     <logtimefmt/>
209                 </item>
210                 <item>
211                     <name>Sessions-会话数</name>
212                     <type>16</type>
213                     <snmp_community/>
214                     <multiplier>0</multiplier>
215                     <snmp_oid/>
216                     <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,sessionCounter]</key>
217                     <delay>30</delay>
218                     <history>90</history>
219                     <trends>365</trends>
220                     <status>0</status>
221                     <value_type>3</value_type>
222                     <allowed_hosts/>
223                     <units/>
224                     <delta>0</delta>
225                     <snmpv3_contextname/>
226                     <snmpv3_securityname/>
227                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
228                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
229                     <snmpv3_authpassphrase/>
230                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
231                     <snmpv3_privpassphrase/>
232                     <formula>1</formula>
233                     <delay_flex/>
234                     <params/>
235                     <ipmi_sensor/>
236                     <data_type>0</data_type>
237                     <authtype>0</authtype>
238                     <username/>
239                     <password/>
240                     <publickey/>
241                     <privatekey/>
242                     <port/>
243                     <description/>
244                     <inventory_link>0</inventory_link>
245                     <applications>
246                         <application>
247                             <name>Sessions</name>
248                         </application>
249                     </applications>
250                     <valuemap/>
251                     <logtimefmt/>
252                 </item>
253                 <item>
254                     <name>http-8080 gzip compression</name>
255                     <type>16</type>
256                     <snmp_community/>
257                     <multiplier>0</multiplier>
258                     <snmp_oid/>
259                     <key>jmx[&quot;Catalina:type=ProtocolHandler,port=8080&quot;,compression]</key>
260                     <delay>30</delay>
261                     <history>90</history>
262                     <trends>0</trends>
263                     <status>0</status>
264                     <value_type>1</value_type>
265                     <allowed_hosts/>
266                     <units/>
267                     <delta>0</delta>
268                     <snmpv3_contextname/>
269                     <snmpv3_securityname/>
270                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
271                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
272                     <snmpv3_authpassphrase/>
273                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
274                     <snmpv3_privpassphrase/>
275                     <formula>1</formula>
276                     <delay_flex/>
277                     <params/>
278                     <ipmi_sensor/>
279                     <data_type>0</data_type>
280                     <authtype>0</authtype>
281                     <username/>
282                     <password/>
283                     <publickey/>
284                     <privatekey/>
285                     <port/>
286                     <description/>
287                     <inventory_link>0</inventory_link>
288                     <applications/>
289                     <valuemap/>
290                     <logtimefmt/>
291                 </item>
292                 <item>
293                     <name>Tomcat version</name>
294                     <type>16</type>
295                     <snmp_community/>
296                     <multiplier>0</multiplier>
297                     <snmp_oid/>
298                     <key>jmx[&quot;Catalina:type=Server&quot;,serverInfo]</key>
299                     <delay>30</delay>
300                     <history>90</history>
301                     <trends>0</trends>
302                     <status>0</status>
303                     <value_type>1</value_type>
304                     <allowed_hosts/>
305                     <units/>
306                     <delta>0</delta>
307                     <snmpv3_contextname/>
308                     <snmpv3_securityname/>
309                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
310                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
311                     <snmpv3_authpassphrase/>
312                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
313                     <snmpv3_privpassphrase/>
314                     <formula>1</formula>
315                     <delay_flex/>
316                     <params/>
317                     <ipmi_sensor/>
318                     <data_type>0</data_type>
319                     <authtype>0</authtype>
320                     <username/>
321                     <password/>
322                     <publickey/>
323                     <privatekey/>
324                     <port/>
325                     <description/>
326                     <inventory_link>0</inventory_link>
327                     <applications>
328                         <application>
329                             <name>Tomcat</name>
330                         </application>
331                     </applications>
332                     <valuemap/>
333                     <logtimefmt/>
334                 </item>
335                 <item>
336                     <name>类-已加载</name>
337                     <type>16</type>
338                     <snmp_community/>
339                     <multiplier>0</multiplier>
340                     <snmp_oid/>
341                     <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;LoadedClassCount&quot;]</key>
342                     <delay>30</delay>
343                     <history>90</history>
344                     <trends>365</trends>
345                     <status>0</status>
346                     <value_type>3</value_type>
347                     <allowed_hosts/>
348                     <units/>
349                     <delta>0</delta>
350                     <snmpv3_contextname/>
351                     <snmpv3_securityname/>
352                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
353                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
354                     <snmpv3_authpassphrase/>
355                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
356                     <snmpv3_privpassphrase/>
357                     <formula>1</formula>
358                     <delay_flex/>
359                     <params/>
360                     <ipmi_sensor/>
361                     <data_type>0</data_type>
362                     <authtype>0</authtype>
363                     <username/>
364                     <password/>
365                     <publickey/>
366                     <privatekey/>
367                     <port/>
368                     <description/>
369                     <inventory_link>0</inventory_link>
370                     <applications>
371                         <application>
372                             <name>class</name>
373                         </application>
374                     </applications>
375                     <valuemap/>
376                     <logtimefmt/>
377                 </item>
378                 <item>
379                     <name>类-总计</name>
380                     <type>16</type>
381                     <snmp_community/>
382                     <multiplier>0</multiplier>
383                     <snmp_oid/>
384                     <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;TotalLoadedClassCount&quot;]</key>
385                     <delay>30</delay>
386                     <history>90</history>
387                     <trends>365</trends>
388                     <status>0</status>
389                     <value_type>3</value_type>
390                     <allowed_hosts/>
391                     <units/>
392                     <delta>0</delta>
393                     <snmpv3_contextname/>
394                     <snmpv3_securityname/>
395                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
396                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
397                     <snmpv3_authpassphrase/>
398                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
399                     <snmpv3_privpassphrase/>
400                     <formula>1</formula>
401                     <delay_flex/>
402                     <params/>
403                     <ipmi_sensor/>
404                     <data_type>0</data_type>
405                     <authtype>0</authtype>
406                     <username/>
407                     <password/>
408                     <publickey/>
409                     <privatekey/>
410                     <port/>
411                     <description/>
412                     <inventory_link>0</inventory_link>
413                     <applications>
414                         <application>
415                             <name>class</name>
416                         </application>
417                     </applications>
418                     <valuemap/>
419                     <logtimefmt/>
420                 </item>
421                 <item>
422                     <name>类-已卸载</name>
423                     <type>16</type>
424                     <snmp_community/>
425                     <multiplier>0</multiplier>
426                     <snmp_oid/>
427                     <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;UnloadedClassCount&quot;]</key>
428                     <delay>30</delay>
429                     <history>90</history>
430                     <trends>365</trends>
431                     <status>0</status>
432                     <value_type>3</value_type>
433                     <allowed_hosts/>
434                     <units/>
435                     <delta>0</delta>
436                     <snmpv3_contextname/>
437                     <snmpv3_securityname/>
438                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
439                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
440                     <snmpv3_authpassphrase/>
441                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
442                     <snmpv3_privpassphrase/>
443                     <formula>1</formula>
444                     <delay_flex/>
445                     <params/>
446                     <ipmi_sensor/>
447                     <data_type>0</data_type>
448                     <authtype>0</authtype>
449                     <username/>
450                     <password/>
451                     <publickey/>
452                     <privatekey/>
453                     <port/>
454                     <description/>
455                     <inventory_link>0</inventory_link>
456                     <applications>
457                         <application>
458                             <name>class</name>
459                         </application>
460                     </applications>
461                     <valuemap/>
462                     <logtimefmt/>
463                 </item>
464                 <item>
465                     <name>堆内存已提交</name>
466                     <type>16</type>
467                     <snmp_community/>
468                     <multiplier>0</multiplier>
469                     <snmp_oid/>
470                     <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.committed&quot;]</key>
471                     <delay>30</delay>
472                     <history>90</history>
473                     <trends>365</trends>
474                     <status>0</status>
475                     <value_type>3</value_type>
476                     <allowed_hosts/>
477                     <units/>
478                     <delta>0</delta>
479                     <snmpv3_contextname/>
480                     <snmpv3_securityname/>
481                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
482                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
483                     <snmpv3_authpassphrase/>
484                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
485                     <snmpv3_privpassphrase/>
486                     <formula>1</formula>
487                     <delay_flex/>
488                     <params/>
489                     <ipmi_sensor/>
490                     <data_type>0</data_type>
491                     <authtype>0</authtype>
492                     <username/>
493                     <password/>
494                     <publickey/>
495                     <privatekey/>
496                     <port/>
497                     <description/>
498                     <inventory_link>0</inventory_link>
499                     <applications>
500                         <application>
501                             <name>HeapStatistics</name>
502                         </application>
503                     </applications>
504                     <valuemap/>
505                     <logtimefmt/>
506                 </item>
507                 <item>
508                     <name>堆内存最大</name>
509                     <type>16</type>
510                     <snmp_community/>
511                     <multiplier>0</multiplier>
512                     <snmp_oid/>
513                     <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.max&quot;]</key>
514                     <delay>30</delay>
515                     <history>90</history>
516                     <trends>365</trends>
517                     <status>0</status>
518                     <value_type>3</value_type>
519                     <allowed_hosts/>
520                     <units/>
521                     <delta>0</delta>
522                     <snmpv3_contextname/>
523                     <snmpv3_securityname/>
524                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
525                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
526                     <snmpv3_authpassphrase/>
527                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
528                     <snmpv3_privpassphrase/>
529                     <formula>1</formula>
530                     <delay_flex/>
531                     <params/>
532                     <ipmi_sensor/>
533                     <data_type>0</data_type>
534                     <authtype>0</authtype>
535                     <username/>
536                     <password/>
537                     <publickey/>
538                     <privatekey/>
539                     <port/>
540                     <description/>
541                     <inventory_link>0</inventory_link>
542                     <applications>
543                         <application>
544                             <name>HeapStatistics</name>
545                         </application>
546                     </applications>
547                     <valuemap/>
548                     <logtimefmt/>
549                 </item>
550                 <item>
551                     <name>堆内存已使用</name>
552                     <type>16</type>
553                     <snmp_community/>
554                     <multiplier>0</multiplier>
555                     <snmp_oid/>
556                     <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.used&quot;]</key>
557                     <delay>30</delay>
558                     <history>90</history>
559                     <trends>365</trends>
560                     <status>0</status>
561                     <value_type>3</value_type>
562                     <allowed_hosts/>
563                     <units/>
564                     <delta>0</delta>
565                     <snmpv3_contextname/>
566                     <snmpv3_securityname/>
567                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
568                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
569                     <snmpv3_authpassphrase/>
570                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
571                     <snmpv3_privpassphrase/>
572                     <formula>1</formula>
573                     <delay_flex/>
574                     <params/>
575                     <ipmi_sensor/>
576                     <data_type>0</data_type>
577                     <authtype>0</authtype>
578                     <username/>
579                     <password/>
580                     <publickey/>
581                     <privatekey/>
582                     <port/>
583                     <description/>
584                     <inventory_link>0</inventory_link>
585                     <applications>
586                         <application>
587                             <name>HeapStatistics</name>
588                         </application>
589                     </applications>
590                     <valuemap/>
591                     <logtimefmt/>
592                 </item>
593                 <item>
594                     <name>http-8080线程峰值</name>
595                     <type>16</type>
596                     <snmp_community/>
597                     <multiplier>0</multiplier>
598                     <snmp_oid/>
599                     <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;PeakThreadCount&quot;]</key>
600                     <delay>30</delay>
601                     <history>90</history>
602                     <trends>365</trends>
603                     <status>0</status>
604                     <value_type>3</value_type>
605                     <allowed_hosts/>
606                     <units/>
607                     <delta>0</delta>
608                     <snmpv3_contextname/>
609                     <snmpv3_securityname/>
610                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
611                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
612                     <snmpv3_authpassphrase/>
613                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
614                     <snmpv3_privpassphrase/>
615                     <formula>1</formula>
616                     <delay_flex/>
617                     <params/>
618                     <ipmi_sensor/>
619                     <data_type>0</data_type>
620                     <authtype>0</authtype>
621                     <username/>
622                     <password/>
623                     <publickey/>
624                     <privatekey/>
625                     <port/>
626                     <description/>
627                     <inventory_link>0</inventory_link>
628                     <applications>
629                         <application>
630                             <name>ThreadStatistics</name>
631                         </application>
632                     </applications>
633                     <valuemap/>
634                     <logtimefmt/>
635                 </item>
636                 <item>
637                     <name>http-8080活动线程</name>
638                     <type>16</type>
639                     <snmp_community/>
640                     <multiplier>0</multiplier>
641                     <snmp_oid/>
642                     <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;ThreadCount&quot;]</key>
643                     <delay>30</delay>
644                     <history>90</history>
645                     <trends>365</trends>
646                     <status>0</status>
647                     <value_type>3</value_type>
648                     <allowed_hosts/>
649                     <units/>
650                     <delta>0</delta>
651                     <snmpv3_contextname/>
652                     <snmpv3_securityname/>
653                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
654                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
655                     <snmpv3_authpassphrase/>
656                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
657                     <snmpv3_privpassphrase/>
658                     <formula>1</formula>
659                     <delay_flex/>
660                     <params/>
661                     <ipmi_sensor/>
662                     <data_type>0</data_type>
663                     <authtype>0</authtype>
664                     <username/>
665                     <password/>
666                     <publickey/>
667                     <privatekey/>
668                     <port/>
669                     <description/>
670                     <inventory_link>0</inventory_link>
671                     <applications>
672                         <application>
673                             <name>ThreadStatistics</name>
674                         </application>
675                     </applications>
676                     <valuemap/>
677                     <logtimefmt/>
678                 </item>
679                 <item>
680                     <name>http-8080线程总计</name>
681                     <type>16</type>
682                     <snmp_community/>
683                     <multiplier>0</multiplier>
684                     <snmp_oid/>
685                     <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;TotalStartedThreadCount&quot;]</key>
686                     <delay>30</delay>
687                     <history>90</history>
688                     <trends>365</trends>
689                     <status>0</status>
690                     <value_type>3</value_type>
691                     <allowed_hosts/>
692                     <units/>
693                     <delta>0</delta>
694                     <snmpv3_contextname/>
695                     <snmpv3_securityname/>
696                     <snmpv3_securitylevel>0</snmpv3_securitylevel>
697                     <snmpv3_authprotocol>0</snmpv3_authprotocol>
698                     <snmpv3_authpassphrase/>
699                     <snmpv3_privprotocol>0</snmpv3_privprotocol>
700                     <snmpv3_privpassphrase/>
701                     <formula>1</formula>
702                     <delay_flex/>
703                     <params/>
704                     <ipmi_sensor/>
705                     <data_type>0</data_type>
706                     <authtype>0</authtype>
707                     <username/>
708                     <password/>
709                     <publickey/>
710                     <privatekey/>
711                     <port/>
712                     <description/>
713                     <inventory_link>0</inventory_link>
714                     <applications>
715                         <application>
716                             <name>ThreadStatistics</name>
717                         </application>
718                     </applications>
719                     <valuemap/>
720                     <logtimefmt/>
721                 </item>
722             </items>
723             <discovery_rules/>
724             <macros/>
725             <templates/>
726             <screens/>
727         </template>
728     </templates>
729     <graphs>
730         <graph>
731             <name>会话状态</name>
732             <width>900</width>
733             <height>200</height>
734             <yaxismin>0.0000</yaxismin>
735             <yaxismax>100.0000</yaxismax>
736             <show_work_period>1</show_work_period>
737             <show_triggers>1</show_triggers>
738             <type>0</type>
739             <show_legend>1</show_legend>
740             <show_3d>0</show_3d>
741             <percent_left>0.0000</percent_left>
742             <percent_right>0.0000</percent_right>
743             <ymin_type_1>0</ymin_type_1>
744             <ymax_type_1>0</ymax_type_1>
745             <ymin_item_1>0</ymin_item_1>
746             <ymax_item_1>0</ymax_item_1>
747             <graph_items>
748                 <graph_item>
749                     <sortorder>0</sortorder>
750                     <drawtype>0</drawtype>
751                     <color>C80000</color>
752                     <yaxisside>0</yaxisside>
753                     <calc_fnc>2</calc_fnc>
754                     <type>0</type>
755                     <item>
756                         <host>Tomcat JMX</host>
757                         <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,maxActive]</key>
758                     </item>
759                 </graph_item>
760                 <graph_item>
761                     <sortorder>1</sortorder>
762                     <drawtype>0</drawtype>
763                     <color>00C800</color>
764                     <yaxisside>0</yaxisside>
765                     <calc_fnc>2</calc_fnc>
766                     <type>0</type>
767                     <item>
768                         <host>Tomcat JMX</host>
769                         <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,activeSessions]</key>
770                     </item>
771                 </graph_item>
772                 <graph_item>
773                     <sortorder>2</sortorder>
774                     <drawtype>0</drawtype>
775                     <color>0000C8</color>
776                     <yaxisside>0</yaxisside>
777                     <calc_fnc>2</calc_fnc>
778                     <type>0</type>
779                     <item>
780                         <host>Tomcat JMX</host>
781                         <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,sessionCounter]</key>
782                     </item>
783                 </graph_item>
784                 <graph_item>
785                     <sortorder>3</sortorder>
786                     <drawtype>0</drawtype>
787                     <color>C800C8</color>
788                     <yaxisside>0</yaxisside>
789                     <calc_fnc>2</calc_fnc>
790                     <type>0</type>
791                     <item>
792                         <host>Tomcat JMX</host>
793                         <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,rejectedSessions]</key>
794                     </item>
795                 </graph_item>
796                 <graph_item>
797                     <sortorder>4</sortorder>
798                     <drawtype>0</drawtype>
799                     <color>00C8C8</color>
800                     <yaxisside>0</yaxisside>
801                     <calc_fnc>2</calc_fnc>
802                     <type>0</type>
803                     <item>
804                         <host>Tomcat JMX</host>
805                         <key>jmx[&quot;Catalina:type=Manager,context=/,host=localhost&quot;,maxActiveSessions]</key>
806                     </item>
807                 </graph_item>
808             </graph_items>
809         </graph>
810         <graph>
811             <name>堆内存状态</name>
812             <width>900</width>
813             <height>200</height>
814             <yaxismin>0.0000</yaxismin>
815             <yaxismax>100.0000</yaxismax>
816             <show_work_period>1</show_work_period>
817             <show_triggers>1</show_triggers>
818             <type>0</type>
819             <show_legend>1</show_legend>
820             <show_3d>0</show_3d>
821             <percent_left>0.0000</percent_left>
822             <percent_right>0.0000</percent_right>
823             <ymin_type_1>0</ymin_type_1>
824             <ymax_type_1>0</ymax_type_1>
825             <ymin_item_1>0</ymin_item_1>
826             <ymax_item_1>0</ymax_item_1>
827             <graph_items>
828                 <graph_item>
829                     <sortorder>0</sortorder>
830                     <drawtype>0</drawtype>
831                     <color>C80000</color>
832                     <yaxisside>0</yaxisside>
833                     <calc_fnc>2</calc_fnc>
834                     <type>0</type>
835                     <item>
836                         <host>Tomcat JMX</host>
837                         <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.used&quot;]</key>
838                     </item>
839                 </graph_item>
840                 <graph_item>
841                     <sortorder>1</sortorder>
842                     <drawtype>0</drawtype>
843                     <color>00C800</color>
844                     <yaxisside>0</yaxisside>
845                     <calc_fnc>2</calc_fnc>
846                     <type>0</type>
847                     <item>
848                         <host>Tomcat JMX</host>
849                         <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.committed&quot;]</key>
850                     </item>
851                 </graph_item>
852                 <graph_item>
853                     <sortorder>2</sortorder>
854                     <drawtype>0</drawtype>
855                     <color>0000C8</color>
856                     <yaxisside>0</yaxisside>
857                     <calc_fnc>2</calc_fnc>
858                     <type>0</type>
859                     <item>
860                         <host>Tomcat JMX</host>
861                         <key>jmx[&quot;java.lang:type=Memory&quot;,&quot;HeapMemoryUsage.max&quot;]</key>
862                     </item>
863                 </graph_item>
864             </graph_items>
865         </graph>
866         <graph>
867             <name>类状态</name>
868             <width>900</width>
869             <height>200</height>
870             <yaxismin>0.0000</yaxismin>
871             <yaxismax>100.0000</yaxismax>
872             <show_work_period>1</show_work_period>
873             <show_triggers>1</show_triggers>
874             <type>0</type>
875             <show_legend>1</show_legend>
876             <show_3d>0</show_3d>
877             <percent_left>0.0000</percent_left>
878             <percent_right>0.0000</percent_right>
879             <ymin_type_1>0</ymin_type_1>
880             <ymax_type_1>0</ymax_type_1>
881             <ymin_item_1>0</ymin_item_1>
882             <ymax_item_1>0</ymax_item_1>
883             <graph_items>
884                 <graph_item>
885                     <sortorder>0</sortorder>
886                     <drawtype>0</drawtype>
887                     <color>C80000</color>
888                     <yaxisside>0</yaxisside>
889                     <calc_fnc>2</calc_fnc>
890                     <type>0</type>
891                     <item>
892                         <host>Tomcat JMX</host>
893                         <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;LoadedClassCount&quot;]</key>
894                     </item>
895                 </graph_item>
896                 <graph_item>
897                     <sortorder>1</sortorder>
898                     <drawtype>0</drawtype>
899                     <color>00C800</color>
900                     <yaxisside>0</yaxisside>
901                     <calc_fnc>2</calc_fnc>
902                     <type>0</type>
903                     <item>
904                         <host>Tomcat JMX</host>
905                         <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;UnloadedClassCount&quot;]</key>
906                     </item>
907                 </graph_item>
908                 <graph_item>
909                     <sortorder>2</sortorder>
910                     <drawtype>0</drawtype>
911                     <color>0000C8</color>
912                     <yaxisside>0</yaxisside>
913                     <calc_fnc>2</calc_fnc>
914                     <type>0</type>
915                     <item>
916                         <host>Tomcat JMX</host>
917                         <key>jmx[&quot;java.lang:type=ClassLoading&quot;,&quot;TotalLoadedClassCount&quot;]</key>
918                     </item>
919                 </graph_item>
920             </graph_items>
921         </graph>
922         <graph>
923             <name>线程状态</name>
924             <width>900</width>
925             <height>200</height>
926             <yaxismin>0.0000</yaxismin>
927             <yaxismax>100.0000</yaxismax>
928             <show_work_period>1</show_work_period>
929             <show_triggers>1</show_triggers>
930             <type>0</type>
931             <show_legend>1</show_legend>
932             <show_3d>0</show_3d>
933             <percent_left>0.0000</percent_left>
934             <percent_right>0.0000</percent_right>
935             <ymin_type_1>0</ymin_type_1>
936             <ymax_type_1>0</ymax_type_1>
937             <ymin_item_1>0</ymin_item_1>
938             <ymax_item_1>0</ymax_item_1>
939             <graph_items>
940                 <graph_item>
941                     <sortorder>0</sortorder>
942                     <drawtype>0</drawtype>
943                     <color>C80000</color>
944                     <yaxisside>0</yaxisside>
945                     <calc_fnc>2</calc_fnc>
946                     <type>0</type>
947                     <item>
948                         <host>Tomcat JMX</host>
949                         <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;ThreadCount&quot;]</key>
950                     </item>
951                 </graph_item>
952                 <graph_item>
953                     <sortorder>1</sortorder>
954                     <drawtype>0</drawtype>
955                     <color>00C800</color>
956                     <yaxisside>0</yaxisside>
957                     <calc_fnc>2</calc_fnc>
958                     <type>0</type>
959                     <item>
960                         <host>Tomcat JMX</host>
961                         <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;PeakThreadCount&quot;]</key>
962                     </item>
963                 </graph_item>
964                 <graph_item>
965                     <sortorder>2</sortorder>
966                     <drawtype>0</drawtype>
967                     <color>0000C8</color>
968                     <yaxisside>0</yaxisside>
969                     <calc_fnc>2</calc_fnc>
970                     <type>0</type>
971                     <item>
972                         <host>Tomcat JMX</host>
973                         <key>jmx[&quot;java.lang:type=Threading&quot;,&quot;TotalStartedThreadCount&quot;]</key>
974                     </item>
975                 </graph_item>
976             </graph_items>
977         </graph>
978     </graphs>
979 </zabbix_export>
View Code

    图形化添加:

 技术图片

技术图片

1.1.4 效果展示

技术图片

技术图片

技术图片

技术图片

 

 

 

 

 

 

   

 

Zabbix监控记录

标签:close   kthread   需要   javap   idt   security   bsp   highlight   超时   

原文地址:https://www.cnblogs.com/yanshicheng/p/10360105.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!