" and "Generate destination file format" both "format" Takes up a significant portion of your daily shell programming. Pull away O (∩_∩) o~)The first is the custom script as Zabbix key, from the corresponding ' data file ' to obtain the values of PV, hits, bandwidth, visits. Use the shell to implement the followingCat web_pv.sh#!/bin/sh# from the Awstats database file such as Api/awstats052016.txt to get ye
After the use of Zabbix for monitoring, often because of the requirements of the project, the need for Zabbix data, two times to share and develop. How to obtain data from Zabbix is a problem to be solved in this practice.
There are two ways to Zabbix data sharing
1 through the database query, get the data. The premise
PHP obtains server monitoring information through the Zabbix API and zabbix server monitoring
The open-source monitoring system Zabbix provides a wide range of APIS for third-party systems to call.
The basic steps are as follows:
1. Obtain valid authentication. Connect to the Zabbi
Python Gets the host name and number of hosts monitored through the Zabbix API#!/usr/bin/env python#-*-Encoding:utf8-*-#Import module, URLLIB2 is a module that simulates the browser HTTP methodImportJSONImportUrllib2ImportSYSImportSmtplib fromUrllib2ImportRequest,urlopen,urlerror,httperror#URL and URL header#Zabbix's API address, user name, password, change to th
Calling the Zabbix API using Python#!/usr/bin/env python#Version = 3.6.1#__auth__ = ' Warren 'ImportJSON fromUrllibImportrequest, Parsezabbix_url='Http://192.168.22.22/zabbix'Zabbix_username="Admin"Zabbix_password="123456"#define the host information to be added in list formhostlist=["192.168.22.111","192.168.22.112"]#Traverse host list defines the host group ID and template ID to add forHostinchHostlist:ur
;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 stop650) 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
Zabbix provides API interfaces and methods that enable you to create hosts, delete hosts, create macros, create templates, and so on, using methods.Here are some examples to see how to use Zabbix-apiZabbix Official Document: Https://www.zabbix.com/documentation/2.2/ru/startTo use the API interface of
Sometimes we need to monitor the running state of the server, Zabbix is such an online monitoring system. At the same time Zabbix provides the API and other ways for other programs to get the data, this article with PHP instance code sharing to let everyone know how to get the server information through Zabbix.
Since
First affixed to the Zabbix official website and the address of the Chinese official website:Https://www.zabbix.com/documentation/3.4/manual/api/reference/item/objectHttps://www.zabbix.com/documentation/3.4/zh/manual/api any problem at any time can find the answer on the official website almost 首先,我们想用利用zabbix的restful
What Zabbix API call API can doZabbix API allows programmatically retrieve and modify the configuration of Zabbix and provides access to Historica L data.It is widely used to:
Create new applications to work with Zabbix;
The Zabbix API can obtain historical data through the json rpc protocol.You can use a script or any tool that supports json rpc to use APIs.
Basic request formatThe simplified JSON request of Zabbix API is as follows:{"Jsonrpc": "2.0 ","Method": "method. name ","Params ":{"Param_1_name": "param_1_value ","Param_2_name"
Objective:The following is a summary of the official documents according to Zabbix 3.2: Https://www.zabbix.com/documentation/3.2/manual/apiThis document simply describes the basic use of the API, and some of the full features or advanced features will be shown in the following blog postInvoking the Zabbix API is using
Zabbix now so popular, personal feeling with Zabbix powerful API has a big relationship, using the API can help us do a lot of things:1, get the related group, host information.2, for example, some people like to get historical data to re-plot.3, add delete host, bind delete template.4. Add Delete Maintenance periodHer
The open source Monitoring system Zabbix provides a rich API for third-party systems to invoke.The basic steps are as follows:1, obtain legal authentication; connect the corresponding Zabbix URL and provide the user name and password, the HTTP method is "POST", the HTTP header type is "Application/json"1 Public functionZabbixjsonrequest ($uri,$data) {2 T
Now more and more companies choose to use open source software Zabbix to do server business monitoring, its high-grid user management is a bright spot, so you can call its interface to apply rights management to a lot of places, such as Fortress machine permissions. The following is a simple script written in Python, by defining the group name can be grouped under the server information.#coding =utf-8__author__= ' perling ' fromurllibimporturlencodeim
The URL to access the Zabbix API is:http://x.x.x.x/zabbix/api_jsonrpc.phpx.x.x.x may be your IP or domain nameOverview of the Access process:1, first Login2. Zabbix server returns a token after successful authentication3, with this token to access a variety of data, do a variety of operations4, Complete!First, log in w
Recently, the hadoop cluster has been upgraded from mrv1 to mrv2, and the monitoring template has also changed .. There are about 200 clusters online. The module is added using the link method, that is, a large number of modules are linked under a template, and then the host is added to this template.
In this case, a machine has about 215 items.To increase the monitoring of NM, the link method is also used to connect the template. When link is found on the page, a blank page is always returned.
Windows, locate the Windows host name by using the NMBLOOKUP-A command.5) Read the scan result file with the Python script and write the hostname to the list.6) Use the Zabbix Python API to invoke the monitored host name and write it to the list.7) Two lists Intersect, using a for loop to determine which host names are not monitored.8) Email Notification supervisor.Below I share the Python script I wrote,
the host with public IP is not exactly the same, for example, some are 1M, some 5M, bandwidth monitoring threshold is the bandwidth value *0.8. For example, 1M bandwidth, the monitoring threshold is 0.8M. (Note: After testing, in the Zabbix trigger this is 0.8M, will not issue an alarm, but the threshold is greater than 1M of the decimal can be alarm, suspect is less than 1M, Zabbix automatically change un
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.