Next to the configuration
Eleven. Zabbix Monitoring Tomcat
1. Installing Java on the Server3 and Tomcat
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/51/wKiom1nfYRXjQPI5AABZFxDBcMg268.png "style=" float : none; "title=" screenshot from 2017-10-11 11-18-17.png "alt=" Wkiom1nfyrxjqpi5aabzfxdbcmg268.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/51/wKiom1nfYRWxwjeUAAD_mHmijRM648.png "style=" float : none; "title=" screenshot from 2017-10-11 11-20-28.png "alt=" Wkiom1nfyrwxwjeuaad_mhmijrm648.png "/>
2. Configure the Tomcat capture script vim catalina.sh
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/08/wKioL1nfXl_TAwBUAADcY-5ragU233.png "style=" float : none; "title=" screenshot from 2017-10-11 11-22-40.png "alt=" Wkiol1nfxl_tawbuaadcy-5ragu233.png "/>
Start Tomcat
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/08/wKioL1nfXl_gIWrNAABl2XBqX_I494.png "style=" float : none; "title=" screenshot from 2017-10-11 11-25-41.png "alt=" Wkiol1nfxl_giwrnaabl2xbqx_i494.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/52/wKiom1nfZinBKhK1AAAfoVfPUDM879.png "title=" Screenshot from 2017-10-11 12-46-53.png "alt=" Wkiom1nfzinbkhk1aaafovfpudm879.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/A7/08/wKioL1nfYzPiiyUJAAF2BWrRQpw835.png "title=" Screenshot from 2017-10-11 11-58-06.png "alt=" Wkiol1nfyzpiiyujaaf2bwrrqpw835.png "/>
3. Add Zabbix Monitor Jave program
Zabbix itself cannot be monitored to jave, after installing Zabbix-java-gateway service, can monitor
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/51/wKiom1nfYRaBSJHIAABzzprd3NM538.png "style=" float : none; "title=" screenshot from 2017-10-11 11-27-20.png "alt=" Wkiom1nfyrabsjhiaabzzprd3nm538.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/08/wKioL1nfXl-zPsMCAADMapogd1k426.png "style=" float : none; "title=" screenshot from 2017-10-11 11-27-32.png "alt=" Wkiol1nfxl-zpsmcaadmapogd1k426.png "/>
Increase the number of processes to 10
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/51/wKiom1nfYRbhakvsAAA_NLF5YhU986.png "style=" float : none; "title=" screenshot from 2017-10-11 11-28-28.png "alt=" Wkiom1nfyrbhakvsaaa_nlf5yhu986.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/51/wKiom1nfYRbSpXm1AABfLdpoBqo967.png "style=" float : none; "title=" screenshot from 2017-10-11 11-30-26.png "alt=" Wkiom1nfyrbspxm1aabfldpobqo967.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/08/wKioL1nfYaDAnFZxAAAei33t_gg173.png "style=" float : none; "title=" screenshot from 2017-10-11 11-34-07.png "alt=" Wkiol1nfyadanfzxaaaei33t_gg173.png "/>
4. Configure the Zabbix server configuration file on the Server1 to add javegateway information
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A7/08/wKioL1nfYaCjC2AXAADGbNFkcto070.png "style=" float : none; "title=" screenshot from 2017-10-11 11-32-02.png "alt=" Wkiol1nfyacjc2axaadgbnfkcto070.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/08/51/wKiom1nfZFaAPvTKAAActnijwMQ867.png "style=" float : none; "title=" screenshot from 2017-10-11 11-32-30.png "alt=" Wkiom1nfzfaapvtkaaactnijwmq867.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A7/08/wKioL1nfYZ_xvFkTAAAjck4iqpY637.png "style=" float : none; "title=" screenshot from 2017-10-11 11-30-36.png "alt=" Wkiol1nfyz_xvfktaaajck4iqpy637.png "/>
5. Adding JMX interfaces interfaces and jmx templates on the Zabbix web
Go to server3 host option
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/08/51/wKiom1nfZFeSupWvAAB1OzZoddw027.png "style=" float : none; "title=" screenshot from 2017-10-11 11-35-48.png "alt=" Wkiom1nfzfesupwvaab1ozzoddw027.png "/>
Add template, generic monitor template more
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/08/wKioL1nfYaCAtAH1AABJATc1l9w560.png "style=" float : none; "title=" screenshot from 2017-10-11 11-36-14.png "alt=" Wkiol1nfyacatah1aabjatc1l9w560.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/51/wKiom1nfZFeyCl07AACoDjEHY84866.png "style=" float : none; "title=" screenshot from 2017-10-11 11-36-23.png "alt=" Wkiom1nfzfeycl07aacodjehy84866.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/08/wKioL1nfYaGgsM9vAADw4ZQrmsk298.png "style=" float : none; "title=" screenshot from 2017-10-11 11-37-03.png "alt=" Wkiol1nfyaggsm9vaadw4zqrmsk298.png "/>
6. Detect and monitor Tomcat success
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/08/52/wKiom1nfZk6Snx8nAACH_x1BVuw054.png "title=" Screenshot from 2017-10-11 13-09-05.png "alt=" Wkiom1nfzk6snx8naach_x1bvuw054.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/51/wKiom1nfZFihqlzkAACSKq6Xttw148.png "style=" float : none; "title=" screenshot from 2017-10-11 11-38-58.png "alt=" Wkiom1nfzfihqlzkaacskq6xttw148.png "/>
Twelve. Zabbix Monitoring Agent
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/A7/08/wKioL1nfZGPRbBqqAAAzJ2lehJ8967.png "title=" Screenshot from 2017-10-12 20-58-37.png "alt=" Wkiol1nfzgprbbqqaaazj2lehj8967.png "/>
1. New virtual machine, install Zabbix agent module
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/08/wKioL1nfZAqwxnGyAAAzFWM9B4g280.png "style=" float : none; "title=" screenshot from 2017-10-11 13-52-28.png "alt=" Wkiol1nfzaqwxngyaaazfwm9b4g280.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/08/wKioL1nfZAvy9e0qAAAl6_ed65k927.png "style=" float : none; "title=" screenshot from 2017-10-11 13-52-39.png "alt=" Wkiol1nfzavy9e0qaaal6_ed65k927.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/08/52/wKiom1nfZ7TzAPO5AAFkfaKmAAY421.png "style=" float : none; "title=" screenshot from 2017-10-11 14-28-00.png "alt=" Wkiom1nfz7tzapo5aafkfakmaay421.png "/>
2. Install the startup database, Create an authorized Zabbix user , import Zabbix data into the database
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/08/52/wKiom1nfZ7SA0it3AAAqYR2MfhQ478.png "style=" float : none; "title=" screenshot from 2017-10-11 14-31-12.png "alt=" Wkiom1nfz7sa0it3aaaqyr2mfhq478.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A7/08/wKioL1nfZP7hGO4-AADPT5tKQJU561.png "style=" float : none; "title=" screenshot from 2017-10-11 14-31-25.png "alt=" Wkiol1nfzp7hgo4-aadpt5tkqju561.png "/>
Import monitoring data
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/08/52/wKiom1nfaTvzl9q2AAApvnTDdqk605.png "style=" float : none; "title=" screenshot from 2017-10-11 14-52-19.png "alt=" Wkiom1nfatvzl9q2aaapvntddqk605.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A7/08/wKioL1nfZoXSAoNdAADN9MkoZL8131.png "style=" float : none; "title=" screenshot from 2017-10-11 14-52-29.png "alt=" Wkiol1nfzoxsaondaadn9mkozl8131.png "/>
3. Configuring the Monitoring Agent file vim/etc/zabbix/zabbix_proxy.conf
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/08/52/wKiom1nfZ7WCsD5hAADIYO9LKYU917.png "style=" float : none; "title=" screenshot from 2017-10-11 14-34-54.png "alt=" Wkiom1nfz7wcsd5haadiyo9lkyu917.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/A7/08/wKioL1nfZP_wootUAABBztCYSIM035.png "style=" float : none; "title=" screenshot from 2017-10-11 14-35-19.png "alt=" Wkiol1nfzp_wootuaabbztcysim035.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/08/wKioL1nfZP-CcVQAAABkPetFruQ421.png "style=" float : none; "title=" screenshot from 2017-10-11 14-35-57.png "alt=" Wkiol1nfzp-ccvqaaabkpetfruq421.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/08/52/wKiom1nfZ7XAj04YAACj-gEO7b0172.png "style=" float : none; "title=" screenshot from 2017-10-11 14-36-49.png "alt=" Wkiom1nfz7xaj04yaacj-geo7b0172.png "/>
Start the service
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/08/52/wKiom1nfZ7Xg3sLuAABolgjBt1c327.png "style=" float : none; "title=" screenshot from 2017-10-11 14-40-24.png "alt=" Wkiom1nfz7xg3sluaabolgjbt1c327.png "/>
4. Configuring proxy mode in Zabbix Web
Server2 Take away Server3
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A7/08/wKioL1nfZP_DaR0mAABost7QXoI499.png "style=" float : none; "title=" screenshot from 2017-10-11 14-43-48.png "alt=" Wkiol1nfzp_dar0maabost7qxoi499.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/A7/08/wKioL1nfZP-QtiowAAB2C87_rOA276.png "style=" float : none; "title=" screenshot from 2017-10-11 14-44-09.png "alt=" Wkiol1nfzp-qtiowaab2c87_roa276.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/08/52/wKiom1nfZ7axG6G8AABk0w-2alM450.png "style=" float : none; "title=" screenshot from 2017-10-11 14-44-25.png "alt=" Wkiom1nfz7axg6g8aabk0w-2alm450.png "/>
5. Configuring the Server3 zabbix_agent file
Point to Proxy server Server2
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/A7/08/wKioL1nfZoWhCwJWAAA-pAJAuPI510.png "style=" float : none; "title=" screenshot from 2017-10-11 15-10-25.png "alt=" Wkiol1nfzowhcwjwaaa-pajaupi510.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/08/52/wKiom1nfaTzBh72tAABYFoGvFOQ478.png "style=" float : none; "title=" screenshot from 2017-10-11 15-10-41.png "alt=" Wkiom1nfatzbh72taabyfogvfoq478.png "/>
Restart Service/etc/init.d/zabbix-agent Restart
6. View Results
View logs for Server1, Server2, and Server3 OK
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M00/08/52/wKiom1nfbDzRJUghAACGisBvCFI966.png "style=" float : none; "title=" screenshot from 2017-10-11 16-29-43.png "alt=" Wkiom1nfbdzrjughaacgisbvcfi966.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/08/52/wKiom1nfaTzwWjXsAACZuNvDT1w655.png "style=" float : none; "title=" screenshot from 2017-10-11 15-54-19.png "alt=" Wkiom1nfatzwwjxsaaczunvdt1w655.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/08/52/wKiom1nfaT3iFTIjAABwDkqq_gg544.png "style=" float : none; "title=" screenshot from 2017-10-11 15-54-32.png "alt=" Wkiom1nfat3iftijaabwdkqq_gg544.png "/>
Viewing the web monitoring side, the acquisition data does not stop
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/08/52/wKiom1nfbD2j6ezBAADAwUXspIs566.png "style=" float : none; "title=" screenshot from 2017-10-11 16-31-22.png "alt=" Wkiom1nfbd2j6ezbaadawuxspis566.png "/>
Network topology diagram for 7.zabbix monitoring
You can set the items you need yourself
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/08/52/wKiom1nfa_PB7PgAAAGksMMAk9U576.png "title=" Screenshot from 2017-10-12 21-18-18.png "alt=" Wkiom1nfa_pb7pgaaagksmmak9u576.png "/>
13. Zabbix adding hosts in the API way
The Zabbix API begins to play an increasingly important role, especially when integrating third-party software and automating daily tasks. It's hard to imagine how difficult it is to manage thousands of servers without automation. The Zabbix API provides a programmable interface for bulk operations, third-party software integration, and other functions.
The Zabbix API was introduced in version 1.8 and has been widely used. All Zabbix mobile clients are API-based and even native web front-end parts are built on top of it. The Zabbix API middleware makes the architecture more modular and avoids direct manipulation of the database. It allows you to create, update, and retrieve Zabbix objects through the JSON RPC protocol and do whatever you like "if you have an authentication account," of course.
The Zabbix API provides two key features:
Remote Management Zabbix Configuration
Remote retrieval of configuration and historical data
Using JSON
The API is implemented with JSON-RPC. This means that any function that is called will need to send a POST request, and the input and output data are in JSON format. The approximate workflow is as follows:
Prepare the JSON object, which describes what you want to do (create a host, get an image, update a monitor item, and so on).
The Post method is used to
1. To do before the monitoring host Server3 deleted, the first step, generate Authentication Tokens
"Jsonrpc": "2.0"-this is the standard JSON RPC parameter to indicate the protocol version. All requests will remain unchanged.
"Method": "User.login"-This parameter defines the action that is actually performed. For example: Host.create, item.update, etc.
"Params"-this is done by passing a JSON object as a parameter to a particular method. If you want to create a monitoring entry, the "name" and "Key_" parameters are required, and the parameters required for each method are described in the Zabbix API documentation.
"id": 1-this field is used to bind JSON requests and responses. The response will have the same "id" as the request. Useful when sending multiple requests at once, and these do not require a single or sequential
"Auth": "*********************"-This is an authentication token "authentication token" to authenticate the user and access the API. This is also the premise of using the API for related operations-get the authentication ID.
Note: Write the command into the shell script
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/09/wKioL1nfanGToPdPAABVH1wmHeU224.png "style=" float : none; "title=" screenshot from 2017-10-11 16-52-15.png "alt=" Wkiol1nfangtopdpaabvh1wmheu224.png "/>
2. Script plus execute permissions, execute build token
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/52/wKiom1nfbSfjKq99AABAJ8Z3VtE216.png "style=" float : none; "title=" screenshot from 2017-10-11 16-52-33.png "alt=" Wkiom1nfbsfjkq99aabaj8z3vte216.png "/>
3. Creating Server3 Host monitoring Entries , execute the following script
Group: Groups ID (you can check the group, which is found later in the browser address bar)
Templates: Template ID (can be selected template, in the browser address bar after the search)
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/09/wKioL1nfanHyvcbEAABiKJmOhvk764.png "style=" float : none; "title=" screenshot from 2017-10-11 16-57-11.png "alt=" Wkiol1nfanhyvcbeaabikjmohvk764.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/08/52/wKiom1nfbSnyScEnAAA3LRmSS50765.png "style=" float : none; "title=" screenshot from 2017-10-11 16-57-24.png "alt=" Wkiom1nfbsnyscenaaa3lrmss50765.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/52/wKiom1nfb-awh2hbAAAn8E3SMAc509.png "style=" float : none; "title=" screenshot from 2017-10-11 17-01-07.png "alt=" Wkiom1nfb-awh2hbaaan8e3smac509.png "/>
4. Add success
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/A7/09/wKioL1nfbh-xbOioAACPrmEUSc8096.png "title=" Screenshot from 2017-10-11 17-03-05.png "alt=" Wkiol1nfbh-xboioaacprmeusc8096.png "/>
14. Passive acquisition mode for Zabbix server (Zabbix agent active )
1. Configure the zabbix_agent.conf file on Server3
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/08/52/wKiom1nfb-aCKwIOAAARX3od4Ao795.png "style=" float : none; "title=" screenshot from 2017-10-11 17-01-40.png "alt=" Wkiom1nfb-ackwioaaarx3od4ao795.png "/>
The IP that will be set between the proxy is re-directed to Server1
Turn off passive mode
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/A7/09/wKioL1nfbnbgBvrPAABQypOJ4IA754.png "style=" float : none; "title=" screenshot from 2017-10-11 17-26-41.png "alt=" Wkiol1nfbnbgbvrpaabqypoj4ia754.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M00/A7/09/wKioL1nfbTChqZoOAAAyU8-iNsE564.png "style=" float : none; "title=" screenshot from 2017-10-11 17-01-34.png "alt=" Wkiol1nfbtchqzooaaayu8-inse564.png "/>
Anent mode of client, 0 indicates off passive mode, ZABBIX-AGENTD does not monitor local port
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/08/52/wKiom1nfcS3R-6sNAABGCBfnO4U092.png "style=" float : none; "title=" screenshot from 2017-10-11 17-27-51.png "alt=" Wkiom1nfcs3r-6snaabgcbfno4u092.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/08/52/wKiom1nfcS2SQ9yYAAA6OJp-lNo630.png "style=" float : none; "title=" screenshot from 2017-10-11 17-28-00.png "alt=" Wkiom1nfcs2sq9yyaaa6ojp-lno630.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/08/52/wKiom1nfcS2hDo_1AABy0NKzTQQ633.png "style=" float : none; "title=" screenshot from 2017-10-11 17-31-23.png "alt=" Wkiom1nfcs2hdo_1aaby0nkztqq633.png "/>
2. Click on the template on the web side, full clone
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/08/52/wKiom1nfcSvwnvcfAAAsvucfBr4630.png "style=" float : none; "title=" screenshot from 2017-10-11 17-23-37.png "alt=" Wkiom1nfcsvwnvcfaaasvucfbr4630.png "/>
Modify the full clone template name for template OS Linux active
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/A7/09/wKioL1nfbnWhhsPYAABtXz7vAEk222.png "style=" float : none; "title=" screenshot from 2017-10-11 17-23-43.png "alt=" Wkiol1nfbnwhhspyaabtxz7vaek222.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/08/52/wKiom1nfcSuQ4wE0AAA47IjDinA614.png "style=" float : none; "title=" screenshot from 2017-10-11 17-23-54.png "alt=" Wkiom1nfcsuq4we0aaa47ijdina614.png "/>
3. Click on the monitoring item, the following template select All
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/A7/09/wKioL1nfbnWBkK4yAAB74LrHdUg159.png "style=" float : none; "title=" screenshot from 2017-10-11 17-24-09.png "alt=" Wkiol1nfbnwbkk4yaab74lrhdug159.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/A7/09/wKioL1nfbnXDglMNAACNlEd1QUo992.png "style=" float : none; "title=" screenshot from 2017-10-11 17-24-13.png "alt=" Wkiol1nfbnxdglmnaacnled1quo992.png "/>
4. Set mode to Zabbix Agent active mode
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/08/52/wKiom1nfcSzzsafpAACDwQinqYc891.png "style=" float : none; "title=" screenshot from 2017-10-11 17-25-07.png "alt=" Wkiom1nfcszzsafpaacdwqinqyc891.png "/>
5. Add the active mode monitor template to the monitor host Server3 and delete the original
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/08/52/wKiom1nfcSyyjCSMAACW8zyI1bQ922.png "style=" float : none; "title=" screenshot from 2017-10-11 17-25-37.png "alt=" Wkiom1nfcsyyjcsmaacw8zyi1bq922.png "/>
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/A7/09/wKioL1nfbnaxNdRXAACdk-MD3kQ852.png "style=" float : none; "title=" screenshot from 2017-10-11 17-25-54.png "alt=" Wkiol1nfbnaxndrxaacdk-md3kq852.png "/>
6. View Zabbix Server passive monitoring results, start collecting normally
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/A7/09/wKioL1nfbneCYSbSAADFCKycnEU711.png "style=" float : none; "title=" screenshot from 2017-10-11 17-31-01.png "alt=" Wkiol1nfbnecysbsaadfckycneu711.png "/>
Zabbix monitoring Tomcat, monitoring agent, API operation, server passive monitoring (2)