zabbix监控模板编写

以tomcat和resin为例:   

1.下载插件cmdline-jmxclient-0.10.3.jar

2.tomcat 监控项目查看(即获取java各项参数名称)(3,4步骤是如果获取参数名称数值,以及对应zabbix的key值表达式)
[email protected]:~# java -jar cmdline-jmxclient-0.10.3.jar - localhost:12345|sort

Catalina:class=org.apache.catalina.UserDatabase,name="UserDatabase",resourcetype=Global,type=Resource
Catalina:context=/docs,host=localhost,name=StandardContextValve,type=Valve
Catalina:context=/docs,host=localhost,type=Cache
Catalina:context=/docs,host=localhost,type=Loader
Catalina:context=/docs,host=localhost,type=Manager
Catalina:context=/docs,host=localhost,type=NamingResources
Catalina:context=/docs,host=localhost,type=WebappClassLoader
Catalina:context=/examples,host=localhost,name=foo/bar/name2,resourcetype=Context,type=Environment
Catalina:context=/examples,host=localhost,name=foo/name1,resourcetype=Context,type=Environment
Catalina:context=/examples,host=localhost,name=foo/name4,resourcetype=Context,type=Environment
Catalina:context=/examples,host=localhost,name=FormAuthenticator,type=Valve
Catalina:context=/examples,host=localhost,name=minExemptions,resourcetype=Context,type=Environment
Catalina:context=/examples,host=localhost,name=name3,resourcetype=Context,type=Environment
Catalina:context=/examples,host=localhost,name=StandardContextValve,type=Valve
Catalina:context=/examples,host=localhost,type=Cache
Catalina:context=/examples,host=localhost,type=Loader
Catalina:context=/examples,host=localhost,type=Manager
Catalina:context=/examples,host=localhost,type=NamingResources
Catalina:context=/examples,host=localhost,type=WebappClassLoader
Catalina:context=/,host=localhost,name=StandardContextValve,type=Valve
Catalina:context=/,host=localhost,type=Cache
Catalina:context=/,host=localhost,type=Loader
Catalina:context=/,host=localhost,type=Manager
Catalina:context=/,host=localhost,type=NamingResources
Catalina:context=/,host=localhost,type=WebappClassLoader
Catalina:context=/host-manager,host=localhost,name=BasicAuthenticator,type=Valve
Catalina:context=/host-manager,host=localhost,name=StandardContextValve,type=Valve
Catalina:context=/host-manager,host=localhost,type=Cache
Catalina:context=/host-manager,host=localhost,type=Loader
Catalina:context=/host-manager,host=localhost,type=Manager
Catalina:context=/host-manager,host=localhost,type=NamingResources
Catalina:context=/host-manager,host=localhost,type=WebappClassLoader
Catalina:context=/manager,host=localhost,name=BasicAuthenticator,type=Valve
Catalina:context=/manager,host=localhost,name=StandardContextValve,type=Valve
Catalina:context=/manager,host=localhost,type=Cache
Catalina:context=/manager,host=localhost,type=Loader
Catalina:context=/manager,host=localhost,type=Manager
Catalina:context=/manager,host=localhost,type=NamingResources
Catalina:context=/manager,host=localhost,type=WebappClassLoader
Catalina:host=localhost,name=AccessLogValve,type=Valve
Catalina:host=localhost,name=ErrorReportValve,type=Valve
Catalina:host=localhost,name=StandardHostValve,type=Valve
Catalina:host=localhost,type=Deployer
Catalina:host=localhost,type=Host
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/docs
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/examples
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/host-manager
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/manager
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Filter,name=TomcatWebSocket (JSR356) Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Servlet,name=default
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,j2eeType=Servlet,name=jsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/docs,name=jsp,type=JspMonitor
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=CompressionFilter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=RequestDumper Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=SetCharacter Encoding
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=Timingfilter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Filter,name=TomcatWebSocket (JSR356) Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async0
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async1
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async2
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=async3
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=ChatServlet
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=CompressionFilterTestServlet
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=CookieExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=default
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=HelloWorldExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=jsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestHeaderExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestInfoExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=RequestParamExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=ServletToJsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=SessionExample
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=stock
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsChat
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsEchoMessage
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsEchoStream
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,j2eeType=Servlet,name=wsSnake
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/examples,name=jsp,type=JspMonitor
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=CSRF
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=SetCharacterEncoding
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Filter,name=TomcatWebSocket (JSR356) Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=default
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=HostManager
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=HTMLHostManager
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,j2eeType=Servlet,name=jsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/host-manager,name=jsp,type=JspMonitor
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Filter,name=TomcatWebSocket (JSR356) Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Servlet,name=default
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,j2eeType=Servlet,name=jsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=CSRF
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=SetCharacterEncoding
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Filter,name=TomcatWebSocket (JSR356) Filter
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=default
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=HTMLManager
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=JMXProxy
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=jsp
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=Manager
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,j2eeType=Servlet,name=Status
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/manager,name=jsp,type=JspMonitor
Catalina:J2EEApplication=none,J2EEServer=none,WebModule=//localhost/,name=jsp,type=JspMonitor
Catalina:name="ajp-bio-8009",type=GlobalRequestProcessor
Catalina:name="ajp-bio-8009",type=ThreadPool
Catalina:name=common,type=ServerClassLoader
Catalina:name="http-bio-8080",type=GlobalRequestProcessor
Catalina:name="http-bio-8080",type=ThreadPool
Catalina:name=StandardEngineValve,type=Valve
Catalina:port=8009,type=Connector
Catalina:port=8009,type=Mapper
Catalina:port=8009,type=ProtocolHandler
Catalina:port=8080,type=Connector
Catalina:port=8080,type=Mapper
Catalina:port=8080,type=ProtocolHandler
Catalina:realmPath=/realm0/realm0,type=Realm
Catalina:realmPath=/realm0,type=Realm
Catalina:type=Engine
Catalina:type=MBeanFactory
Catalina:type=NamingResources
Catalina:type=Server
Catalina:type=Service
Catalina:type=StringCache
com.sun.management:type=HotSpotDiagnostic
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=CodeCache,type=MemoryPool
java.lang:name=PSEden Space,type=MemoryPool
java.lang:name=PSMarkSweep,type=GarbageCollector
java.lang:name=PSOld Gen,type=MemoryPool
java.lang:name=PSPerm Gen,type=MemoryPool
java.lang:name=PSScavenge,type=GarbageCollector
java.lang:name=PSSurvivor Space,type=MemoryPool
java.lang:type=ClassLoading
java.lang:type=Compilation
java.lang:type=Memory
java.lang:type=OperatingSystem
java.lang:type=Runtime
java.lang:type=Threading
java.nio:name=direct,type=BufferPool
java.nio:name=mapped,type=BufferPool
java.util.logging:type=Logging
JMImplementation:type=MBeanServerDelegate
Users:database=UserDatabase,type=UserDatabase
3.如何获取数据()
[email protected]:~# java -jar cmdline-jmxclient-0.10.3.jar - localhost:12345 java.lang:type=ClassLoading LoadedClassCount
01/29/2015 13:52:29 -0500org.archive.jmx.Client LoadedClassCount: 2411
4.对应zabbixkey的表达式
jmx["java.lang:type=ClassLoading",LoadedClassCount]

二.resin jmx 开启方式      
1.Resin 的resin.xml文件里面设置(( disable passwordchecking and SSL))
< cluster id="">
<server-default>
   <jvm-arg>-Xmx512m</jvm-arg>
   <jvm-arg>-Xss1m</jvm-arg>
   <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
   <jvm-arg>-Dcom.sun.management.jmxremote.port=12345</jvm-arg>
   <jvm-arg>-Dcom.sun.management.jmxremote.ssl=false</jvm-arg>   <jvm-arg>-Dcom.sun.management.jmxremote.authenticate=false</jvm-arg>
</server-default>
<server id="app-a" address="172.20.0.2"/>
< /cluster>

spacer.jpg (43 Bytes, 下载次数: 0)

下载附件  保存到相册

2015-1-30 09:44 上传

2.resin监控项目查看(3,4步骤是如果获取参数名称数值,以及对应zabbix的key值表达式)
[email protected]:~# java -jarcmdline-jmxclient-0.10.3.jar - localhost:12345|sort

com.sun.management:type=HotSpotDiagnostic
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=Code Cache,type=MemoryPool
java.lang:name=PS Eden Space,type=MemoryPool
java.lang:name=PS MarkSweep,type=GarbageCollector
java.lang:name=PS Old Gen,type=MemoryPool
java.lang:name=PS Perm Gen,type=MemoryPool
java.lang:name=PS Scavenge,type=GarbageCollector
java.lang:name=PS Survivor Space,type=MemoryPool
java.lang:type=ClassLoading
java.lang:type=Compilation
java.lang:type=Memory
java.lang:type=OperatingSystem
java.lang:type=Runtime
java.lang:type=Threading
java.nio:name=direct,type=BufferPool
java.nio:name=mapped,type=BufferPool
java.util.logging:type=Logging
JMImplementation:type=MBeanServerDelegate
resin:name=app-0,type=ClusterServer
resin:name=app-a,type=ClusterServer
resin:name=app,type=Cluster
resin:name="classpath:/META-INF/caucho/app-default.xml",type=Config
resin:name="file:/usr/local/resin/conf/cluster-default.xml",type=Config
resin:name="file:/usr/local/resin/conf/health.xml",type=Config
resin:name="file:/usr/local/resin/conf/resin.xml",type=Config
resin:name=memcached,type=Cluster
resin:name=proxycache,type=Cluster
resin:name="resin:system|resin",type=Cache
resin:name="",type=Cluster
resin:name=web,type=Cluster
resin:type=BamService
resin:type=BlockManager
resin:type=CacheStore
resin:type=Environment
resin:type=LocalRepository
resin:type=Management
resin:type=Memory
resin:type=Resin
resin:type=Server
resin:type=ThreadPool
resin:type=TransactionManager
3.如何获取数据
[email protected]:~# java -jarcmdline-jmxclient-0.10.3.jar - localhost:12345 java.lang:type=ClassLoadingLoadedClassCount
01/29/2015 13:44:00 -0500org.archive.jmx.Client LoadedClassCount: 3324
4.对应zabbixkey的表达式
jmx["java.lang:type=ClassLoading",LoadedClassCount]

时间: 2024-10-30 12:57:27

zabbix监控模板编写的相关文章

zabbix监控模板修改及调优(不完整版)

简介监控一直在不同的层面为我们的运维工作发挥着重要的作用:网络层监控,及时发现网络间的访问质量(如我们之前介绍的全国maps网络监控):服务器监控,了解服务器各项性能参数(如常见的zabbix.cacti.nagios.ganglia等):应用性能监控,深入监测具体业务的性能情况(如我们之前提到的APM监控系统)其中,服务器监控作为一种传统的监控类型,我们结合不同场景中也用到了多种方案.而在众多方案中,zabbix由于其强大的功能和灵活的自动化特性,尤其得到我们的广泛使用.为了打造出适合自己的z

分布式开源zabbix 监控模板汇总

分布式开源监控服务器zabbix 最新监控模板,请访问: www.zabbix.org/wiki/Zabbix_Templates 包含以下几个方面: 1.Network devices 2.Servers 3.Network Appliances 4.Monitoring Equipment 5.Power (UPS) 6.Printers 7.Cooling (A/C) 8.Applications 9.Database 10.Storage Devices 11.Operating Sys

MongoDB升级到3.0以上的Zabbix监控模板变更

一 应用场景描述 线上一些MongoDB数据库实例升级到了3.0,查看Zabbix server的日志不断有监控主机的MongoDB监控报错 6697:20160519:222116.590 error reason for "xxxxxxxx:MongoDB.Discovery_Status[backgroundFlushing,average_ms,xxxxxxx:1901]" changed: Received value [2016-05-19T22:21:07.391+080

使用Zabbix监控RabbitMQ

一 应用场景描述 线上业务使用RabbitMQ作为消息队列中间件,那么作为运维人员对RabbitMQ的监控就很重要,本文就针对如何从头到尾使用Zabbix来监控RabbitMQ进行说明. 二 RabbitMQ监控要点 RabbitMQ官方提供两种方法来管理和监控RabbitMQ. 1.使用rabbitmqctl管理和监控 Usage: rabbitmqctl [-n <node>] [-q] <command> [<command options>] 查看虚拟主机 #

Zabbix监控Tengine 后端服务器健康检查

一 应用场景描述: 前端使用Tengine作为负载均衡器,需要对监控Tengine到后端服务器的健康状况,利用Tengine提供的接口可以获取每一个后端主机的状态,是up还是down等. 二 编写Zabbix监控脚本 Tengine的ngx_http_upstream_check_module 模块提供后端监控检查功能.可以使用html,csv,json三种格式查看后端主机状态,这里我们使用json格式便于编写脚本 /status?format=html /status?format=csv /

zabbix 监控ElasticSearch

使用elasticsearch的健康检查命令来监控其集群状态:  curl -s -XGET 192.168.1.22:9200/_cluster/health?pretty {   "cluster_name" : "elastic",   "status" : "green",   "timed_out" : false,   "number_of_nodes" : 3,   &qu

zabbix监控之zabbix源码部署 (安装篇)

[本文档所介绍的内容适用于公司测试/生产环境等常见的zabbix监控系统部署] 一:Zabbix部署前环境要求: 1.1相关软件以及系统 系统要求:Centos 6.6 (64位) 运行环境要求: php环境(LAMP或 LNMP) 相关中间件:zabbix-2.4.6.tar.gz 1.2 检查系统自带是否安装Zabbix软件包 rpm -qa | grep zabbix 如有安装,请使用以下命令卸载相关程序 yum remove zabbix 二:zabbix正式部署安装 2.1 zabbi

zabbix使用自己编写脚本模板和zabbix自带模板两种方法添加对指定进程和端口的监控

zabbix使用自己编写脚本模板和zabbix自带模板两种方法添加对指定进程和端口的监控 1.自带监控模板进行os的监控 进入/usr/local/zabbix/etc/zabbix_agentd.conf 配置文件修改 LogRemoteCommands=1     ###开启脚本功能 Server=192.168.5.129     ##修改zabbix指向的服务器: 重启zabbix_agentd.zabbix_server服务 在配置-->主机-->添加主机--> 配置主机信息主

使用zabbix自带MySQL监控模板监控MySQL

目前使用的zabbix版本是2.2.3,自带MySQL监控模板Template App MySQL,只是监控项目比较少.如果只是想对MySQL进行基本的监控,可以使用这个模板,如果要详细监控MySQL的各种信息,例如数据库的各种状态,主从复制状态,InnoDB状态等信息需要另外编写模板.后续再讨论. 参考文章 http://os.51cto.com/art/201404/435139.htm https://zabbix.org/mw/images/d/d4/Template_App_MySQL