首页 > 代码库 > zabbix 监控solr

zabbix 监控solr

版本:centos6.4 jdk1.8 solr5.5.3 zabbix3.2.1


solr安装:

1、解压包:
tar -zxvf  solr-5.5.3.tgz

2、开启remote_jmx
vim  /usr/local/solr-5.5.3/bin/solr.in.sh

ENABLE_REMOTE_JMX_OPTS="true"
RMI_PORT=8680

3、启动solr
 ln -s /usr/local/solr-5.5.3/bin/solr /usr/bin/solr
 solr start
 
4.查看是否正常启动
lsof -i:8983


技术分享

cd  zabbix-3.2.1
./configure -enable-java --prefix=/opt/zabbix_java

开启zabbix_java_gateway

zabbix3.2.1版本默认自带了zabbix_java_gateway!只需要在zabbix_server.conf去掉注释即可
JavaGateway=192.168.47.128  #最好别用127.0.0.1
JavaGatewayPort=10052
StartJavaPollers=5



然后重启下zabbix_server!
查看端口是否正常:
 lsof -i:10052

技术分享


在zabbix_server上通过cmdline-jmxclient-0.10.3.jar 查看是否能够获取到值

java -jar cmdline-jmxclient-0.10.3.jar - 192.168.47.128:8680
获的结果:
java.lang:type=OperatingSystem
java.lang:name=Metaspace Manager,type=MemoryManager
java.lang:name=Metaspace,type=MemoryPool
JMImplementation:type=MBeanServerDelegate
java.lang:name=ParNew,type=GarbageCollector
java.lang:type=ClassLoading
java.lang:type=Runtime
java.lang:name=Par Eden Space,type=MemoryPool
java.lang:name=ConcurrentMarkSweep,type=GarbageCollector
com.sun.management:type=HotSpotDiagnostic
java.lang:type=Threading
java.lang:name=CodeCacheManager,type=MemoryManager
java.nio:name=mapped,type=BufferPool
java.lang:name=Code Cache,type=MemoryPool
java.lang:name=Compressed Class Space,type=MemoryPool
java.nio:name=direct,type=BufferPool
java.lang:name=Par Survivor Space,type=MemoryPool
java.util.logging:type=Logging
com.sun.management:type=DiagnosticCommand
java.lang:type=Memory
java.lang:name=CMS Old Gen,type=MemoryPool
java.lang:type=Compilation

###################################################################################

java -jar cmdline-jmxclient-0.10.3.jar - 192.168.47.128:8680 java.lang:type=OperatingSystem
Attributes:
 OpenFileDescriptorCount: OpenFileDescriptorCount (type=long)
 MaxFileDescriptorCount: MaxFileDescriptorCount (type=long)
 CommittedVirtualMemorySize: CommittedVirtualMemorySize (type=long)
 TotalSwapSpaceSize: TotalSwapSpaceSize (type=long)
 FreeSwapSpaceSize: FreeSwapSpaceSize (type=long)
 ProcessCpuTime: ProcessCpuTime (type=long)
 FreePhysicalMemorySize: FreePhysicalMemorySize (type=long)
 TotalPhysicalMemorySize: TotalPhysicalMemorySize (type=long)
 SystemCpuLoad: SystemCpuLoad (type=double)
 ProcessCpuLoad: ProcessCpuLoad (type=double)
 AvailableProcessors: AvailableProcessors (type=int)
 Arch: Arch (type=java.lang.String)
 Version: Version (type=java.lang.String)
 SystemLoadAverage: SystemLoadAverage (type=double)
 Name: Name (type=java.lang.String)
 ObjectName: ObjectName (type=javax.management.ObjectName)


#########################################################################

java -jar cmdline-jmxclient-0.10.3.jar - 192.168.47.128:8680 java.lang:type=OperatingSystem OpenFileDescriptorCount
12/14/2016 23:10:27 -0800 org.archive.jmx.Client OpenFileDescriptorCount: 102



zabbix添加一个主机

技术分享


添加一个solr模板

技术分享

技术分享

技术分享


最后成功出图:

技术分享

zabbix 监控solr