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 with RestclientIn the body of the JSON request, you have the following properties:
jsonrpc-Version of the JSON-RPC protocol use
Tags: get open CTI count for close argv list src Because the database additions and deletions suddenly burst, need to query is the operation of those tables is particularly frequent, wrote a tool to analyze Bin-log, find and add to change the table, and the number of operations in descending order, the following is the code:
1 2 3 4 5 6 7 8 9 Ten One A - - the - - - + - + A at - - - - - in - to + - the * $
introduction logging module is a python built-in standard module, mainly used for output log, you can set the level of output logs, log save path, log files and rollback, etc. It can be said that the logging module consists mainly of 4 parts: *logger Logger , which provides interfaces that application code ca
The method of writing a log is various, I this is I like the method, can make a referenceThere's nothing to say, just the code.Import TimedefWrite_log (value): Now_time= Time.time ()#get the current date and timeTime_format ='%y-%m-%d%h:%m:%s' #Specify the date and time formatTime_put = Time.strftime (time_format,now_time)#format time, time becomes YYYY-MM-DD HH:MI:SSfile_name ='/log/log.log'Log_file= Open
are ordinary strings and Unicode strings, it is recommended to use Unicode strings!Because each + creates a new string, in order to avoid a lot of temporary strings, use the Join methodsl=["Hello", "we", "Love", "python"]SL = "". Join (SL) Print SLA single string is linked with a space as an intermediate symbol.Unicode encodingThe utf-8 is variable, one byte to four bytes, usually one kanji account of three bytes, or fourUtf-16 and utf-32, respective
less than 10 lines continue to 1000 reads, and so forth ~Specific implementation:#!/usr/bin/envpython#-*-coding:utf-8-*-"" "##authors:limanman# 51ctobg:http://xmdevops.blog.51cto.com/#purpose:# "" "From__future__importabsolute _import# Description: Import Public module importosimportsysimporttimeimportchardet# Description: Import other modules #if__name__== ' __main__ ':seekps=0; target= ' Data.txt ';try: # the pointer jumps to the end as the read position withopen ( target, ' r+b ') asf: F.se
processedPrint("The buns are finished .")defConsumer (name): whileTrue:ifQ.qsize () >0:Print("%s ate bun%s ....."%(Name,q.get ())) Q.task_done ()##告知这个任务执行完了Time.sleep (1) P=threading. Thread (target=producer,args= ("QJJ",)) C=threading. Thread (target=consumer,args= ("LSJ",)) P.start () C.start ( )"""qjj production of steamed bun 0...LSJ ate bun 0.....qjj production of steamed bun 1...LSJ ate bun 1.....qjj production of steamed bun 2...qjj production of steamed bun 3...lsj to eat the steamed b
in the regular expression into a backslash. The native string in Python solves this problem well, and the regular expression in this example can be expressed using R "\ \". Similarly, a "\\d" that matches a number can be written as r "\d". With the native string, you no longer have to worry about missing the backslash, and the expression is more intuitive.Re. I (re. IGNORECASE): Ignore case (full notation within parentheses, same as) M (MULTILINE): M
9 Month Thursday Today is a special day, always feel 9 months this day sounds strange. This morning, "Head first HTML and CSS" Chapter " table and more list ", not much content, read and do detailed notes and exercises. See Chapter "HTML form " Tomorrow, in fact the book is in total , chapter IV is " appendices and other " . The book will be finished by tomorrow and the next day. Also is to lay a foundation, continue to learn more advanced things to go. This afternoon read the"list" o
This morning did not concentrate on the study, I feel I may be tired, need to reduce the degree of learning to adjust a bit. These days the computer to make the faint sky, the body a little too unbearable. Time is a magical magic, and for half a month, every few days there is an idea to change strategy. The book I read this morning is Chapter 6 of Head first HTML and CSS , a primer onCSS . About half of it, there are more than 20 pages to see. What's the whole thing this morning? On the entire
of three nights of tossing, today successfully installed the Ubuntu operating system. Although there are many unhappy things in the middle that I did not think of, anyway, I can go to bed early tonight.Think about this half-month life, every day addicted to learning, I have not so dedicated my life to love to learn this thing. I've always had a problem where my eyes can see where I don't allow myself to be inferior to others. The hardest thing is that people know that I don't know. This strange
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.