Python executes shell to obtain hardware parameters and writes them to mysql and pythonmysql.
Recently, you need to obtain various Server parameters, including cpu, memory, disk, and model information. Hyperic HQ, Nagios, and Snmp have been used for trial. They all have powerful functions, but they are either too powerful or too heavy.
Therefore, you can use python to execute shell to obtain the information
Label:Recently to obtain the server various parameters, including CPU, memory, disk, model and other information. Hyperic HQ, Nagios, and SNMP have been tried, but they are powerful, but not too heavy.So the idea of Python executing the shell to get this information is that Python executes shell scripts in the following three ways:1. Os.system ()Os.system ('ls')#返回结果0或者1, the output of the command cannot be
This example describes how Python executes the shell to get hardware parameters written to MySQL. Share to everyone for your reference. The specific analysis is as follows:
Recently to obtain the server various parameters, including CPU, memory, disk, model and other information. Hyperic HQ, Nagios, and SNMP have been tried, but they are powerful, but not too heavy.
So the idea of Python executing the shel
This article mainly introduces how to write hardware parameters to mysql by executing shell in python. it can read server hardware information and write data to the database, which is of great practical value, for more information about how to write hardware parameters to mysql, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
Recently, you need to obtain various server parameters, including cpu, memory, disk, and model information.
The example in this article describes how Python performs a shell acquisition of hardware parameters written to MySQL. Share to everyone for your reference. The specific analysis is as follows:
Recently to get the various parameters of the server, including CPU, memory, disk, model and other information. Hyperic HQ, Nagios, and SNMP have been tried, but the requirements are not too strong or too heavy.
Wi
message, memory usage, and so on.
This is the camel function of the Open box. Each camel application collects JMX statistics by default, including information about the entire application, private routing information, terminals, and consumer component information. It will tell you how many messages have been successfully processed, where there have been few failures, where they have failed, and so on. These APIs are not read-only, and JMX allows you to update and tweak your programs during run
If you read all the MAC addresses, print the MAC address in the following code.Package sigar-1.6.3.jar to be referencedDuring the test, I loaded all the built-in dynamic libraries of sigar.For details, see the main method.
Import java. Io. bufferedreader;Import java. Io. file;Import java. Io. filewriter;Import java. Io. inputstreamreader;
Import org. hyperic. sigar. cpuperc;Import org. hyperic. sigar. siga
Once the database is restored, open reports an error ORA-00349, as shown below. Finally, delete the log group. SQL> alter database open resetlogs; alter database open resetlogs * ERROR at line 1: ORA-00349: failure obtaining block size for '+ fra_kg01_dselect group #, name, bytes, status from v $ logfile; SQL>/1/paic/hq/bk/restore/data/oradata/aims/group_1.257.788444161 1/paic/hq/bk/restore/data/oradata/aim
provided by Microsoft to develop high-performance graphics, sound, input, output, and online games on Windows platforms. DirectShow is a member of DirectX, it is used for audio and video data collection, multimedia file playback, and other applications. The most basic functional module in DirectShow is filter (each rectangle block in Figure 6 represents a filter). Each filter has at least one pin for receiving or outputting data; filter always provides certain functions (in figure 6, the first
Developing a device driver-> device driver development concepts-> device InterfacesThe following code example shows a simple use of createmsgqueue, requestdevicenotifications, waitforsingleobject, and stopdevicenotifications.
# Include # Include
# Include
Typedef Union {Devdetail D;Char pad [sizeof (devdetail) + max_devclass_namelen];} Mydev;
Void enumeratedevices (handle H){Mydev detail;DWORD flags;DWORD size;
Setlasterror (0 );
While (readmsgqueue (H, detail, sizeof (detail), size, 1, fla
. Lucene. util. priorityqueue;/** A {@ link hitcollector} implementation that collects the top-Scoring* Events, returning them as a {@ link topdocs}. This is used{@ Link* Indexsearcher} to implement {@ link topdocs}-based search.**This may be extended, overriding the collect method to, e.g .,* Conditionally invoke super () in order to filter which* Documents are collected.**/Public class topdoccollector extends hitcollector {Private int numhits;Private float minscore = 0.0f;Int totalhits;Priorit
, making the data transmission configuration simpler;
2 queues in the queue Manager can be specified as Cluster shared queues, visible to all queue managers in Cluster, and Cluster shared queues defined in different queue managers automatically implement load balancing for the queue;
3 a master-slave relationship can be specified between broker agents of different queue managers, so that tree-like pub/sub structures can be conveniently implemented in Cluster.
Once you have configured WebSpher
, you can see this interface:Https://xueqiu.com/hq#exchange=CNplate=1_1_0firstName=1secondName=1_1type=shapage=1Forgive me really do not understand the stock market, just think this is the list of all stock prices, brick home do not spray ~Okay, let's take a look at the next page of law.https://xueqiu.com/hq#exchange=CNplate=1_1_0firstName=1secondName=1_1type=shapage=2Https://xueqiu.com/
/user0100.dbf ' to '/opt/ora10g/oradata/orcl/userrename2.dbf ', '/opt/ora10g/oradata/orcl/usERRENAME1.DBF ';
Database altered.
sql> ALTER DATABASE open; Database altered.
Also attached is a batch modification of the data file name statement
Set pagesize 999
set linesize 999
select ' ALTER DATABASE rename file ' | | member| | ' | | | Chr (39) | | Replace (member, '/paic/hq/bk/restore/data/oradata/lass/', '/paic/z4ah8020/stg/lass/oradata/hs03lass/')
open;
Alter database open
*
ERROR at line 1:
Ora-01113:file 106 Needs Media recovery
Ora-01110:data file 106: '/opt/ora10g/oradata/orcl/user099.dbf '
--This cannot open because just shut down the database wrote userrename2.dbf and userrename1.dbf the SCN of the two data files, while USER099.DBF and user0100.dbf SCN or offline time, so control the file header and data text The database cannot be opened because the header is inconsistent.
sql> alter database rename file
terms of efficiency, although the crawler itself can help us to do a lot of things, but it is better to find the list URL directly will be faster. We continue to look in, you can see this interface:Https://xueqiu.com/hq#exchange=CNplate=1_1_0firstName=1secondName=1_1type=shapage=1650) this.width=650; "Src=" http://img.blog.csdn.net/20160521104754447?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/7
.
For devices that support mobile storage (such as USB flash drives, SD cards, and CF cards), I think Autorun technology is a very powerful method. Then, it runs. It is very simple but practical, similar to the CD/DVD Autorun technology. Windows Mobile directly supports Autorun. In fact, it is easy to implement on Windows CE: runtime runs.
To implement this function, you must first create a message queue during initialization to wait for the system device plugging time notification:Code
Code hi
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.