Php code for obtaining the linux server status
Example: php code used to obtain the status of a linux server.
Function get_used_status (){
$ Fp = popen ('top-B-n 2 | grep-E "^ (Cpu | Mem | Tasks)" ', "r "); // Obtain the cpu and memory usage of the system at a specific time point
System environment: centos6.3 x64
apache:httpd-2.4.4
zabbix:zabbix-2.06
First download the template on this machine: Https://github.com/rdvn/zabbix-templates/archive/master.zip
The ZIP package has Apache, Memcache, Redis, varnish templates, we unzipped the use of the Apache template
First, open the server-status of Apache:
# vi/usr/local/apache2/conf/httpd.conf
The last line adds the following:
----
Problem Description:after starting the transaction, the Java code makes a query, then inserts, which is reported at this time: java.sql.SQLException:could not retrieve transation read-only status serverresolution process:View MySQL 's things isolation level show VARIABLES like '%iso% '; results returned: repeatable-read change this to: read-committed: SET GLOBAL tx_isolation= ' read-committed '; (Remember the Java Restart app, to be permanently
Tags: tab like start read_only error exce problem analysis ret DeleteProblem Description:After starting the transaction, the Java code makes a query, then inserts, which is reported at this time: Java.sql.SQLException:could not retrieve transation read-only status serverresolution process: View MySQL's things isolation level show VARIABLES like '%iso% '; return Result: Repeatable-read Change this to: read-committed: SET GLOBAL tx_isolation= ' read-co
Symptom:System log files (Control Panel-management tools-system logs)You can find the following two errors:17052:The master database cannot be recovered. Exiting.18052:Error: 9003, severity: 20, status: 1.
Solution:
Rename the Microsoft SQL Server/MSSQL/data directory to the data_bak directory, and then set the master from other machines. MDF, master. LDF, model. MDF, modellog. LDF cannot be copied to the
The error message is as follows:
HTTP Status 500–internal Server Error ...
The solution:In the recent installation and configuration of SOLR Search server, the problem encountered, but by virtue of experience to see the problem, recorded to facilitate access to other people, the wrong contents of the following figure:
As shown in the error section above,Note: Co
started in the background to control it, or look at the situationof the class. Start with the following command:erl-name [email protected]where B is also an English name, but note that it cannot be the same as the previous one (even if the IP is different). ThisThe IP at the office seems to be easy to write because it does not need to be connected back to B from a. But if you want, you might want to write aA valid IP that can be accessed from a to B.After booting, enter into the interactive env
Example, PHP gets the Linux server status code.
function Get_used_status () {
$fp = Popen (' top-b-N 2 | grep-e "^ (cpu| mem| Tasks) "'," "R");//Get a moment of system CPU and memory usage
$rs = "";
while (!feof ($fp)) {
$rs. = Fread ($fp, 1024);
}
Pclose ($FP);
$sys _info = explode ("\ n", $rs);
$tast _info = Explode (",", $sys _info[3]);//proce
It is useful if the server has multiple users or check whether there are other illegal users logging on.
Create two files "ts2003.bat" and "ts2003.log" under the d directory ).
Compile the "ts2003.bat" script file:
CopyCodeThe Code is as follows: Time/T> ts2003.log
Netstat-n-p tcp | find ": 3389"> ts2003.log
Start Explorer
The first line of code is used to record the User Logon Time. "Time/t" indicates that the system time is returned, use the a
Failed to load resource:the Server responded and a status of 404 (not Found) error point.. /FONTS/GLYPHICONS-HALFLINGS-REGULAR.WOFF2
VS2013 use bootstrap, the introduction of local bootstrap files always error.
There are two possible reasons:
1.See is the reference
There is a problem with the path, specifically in the introduction of the font file, the file is missing, the corresponding path can be copied
java.sql.sqlexception:could not retrieve transation the status server read-only into T_user VALUES (?,?,?,?,?,?,?,?) Parameters: [NULL, SS, 123, SS, 1, 1111] at Org.apache.commons.dbutils.AbstractQueryRunner.rethrow (abstractqu eryrunner.java:320) at Org.apache.commons.dbutils.QueryRunner.update (queryrunner.java:489) at ORG.APACHE.COMMONS.D Butils. Queryrunner.update (queryrunner.java:402) at Cn.itcast.jdb
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.