In Qt, you often invoke external commands or execute shell scripts, and you want to analyze the execution results.Qprocess runshellprocess =new qprocess (this); // Monitoring of invoking process outputs This , SLOT (Readprocess ())); Connect (runshellprocess, SIGNAL (finished (intThis, SLOT (Finishedprocess ()));Then analyze in readprocess () and finishedprocess ()voidMainwindow::executeshellqprocess (Const Char*
Monitor multiple database loads simultaneously using Shell scripts
In normal work, there are still a lot of databases to be managed. Because of the relationship between remote access and permissions, some graphic tools cannot be accessed. Sometimes it feels like a serial process when performing checks, in this way, the check is not targeted enough. For example, we do not know the scope of database load duri
Our website now uses some tools to monitor whether the website server can be accessed, but not the status of the website. Next I will recommend you to use shell to monitor the website status script in linux.
Today, I wrote shell monitoring for my website, so I don't know if my website goes down. This script checks the
The shell monitors whether the website is running automatically and restarts automatically#!/bin/Bashwget--spider-q-o/dev/NULL--tries=1-T5www.baidu.comif[$?-eq0]; Then Echo "' Date ' site access is normal! ">>/root/Web_monitor.logElse Echo "' Date ' site access exception! Restart Service">>/root/Web_monitor.log#重启服务脚本SH/root/restart.SH if[$?-eq0]; Then Echo "' Date ' Restart service succeeded">>/root/Web_monitor.logElse Echo "' Date
the start of the system to the current time, in addition to the hard disk IO wait time other than waiting time.Iowait (1620): The hard disk IO wait time is accumulated from the start of the system to the current time.IRQ (5): Accumulates from the start of the system to the current moment, hard interrupt time.SOFTIRQ (457): Accumulated from the start of the system to the current moment, soft interrupt time.CPU Time =USER+NICE+SYSTEM+IDLE+IOWAIT+IRQ+SOFTIRQ.CPU utilization = (IDLE2-IDLE1)/(CPU2-C
/71/78/wKioL1XRm_TxDSUPAAJMwxVjvJU543.jpg "title=" 7.png " alt= "Wkiol1xrm_txdsupaajmwxvjvju543.jpg"/>After adding a good graphic prototype, the template was made successful, and then added to the host, you can get the data, here because I set the automatic discovery interval is 5 minutes, so need to wait more than five minutes to appear graphics, the following is the appearance of the graphic effect.650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/7C/wKiom1XRmx_AOSB-AAEW17BFdNE243.
Use the shell to monitor CPU, disk, memory usage, reach alert thresholds and email notificationsAnd with the task plan, you can get the alarm information in time#!/bin/bash############################################## #Author:liuzhengwei-[email Protected] #QQ: 1135960569#lastmodified:2017-04-1921:50#filename:jiankong.sh#description : ############################################## #获取cpu使用率cpuUsage = ' Top-
Share a daily use of the monitoring network, disk usage, average load and ram used by shell scriptsThe script is in the attachment.Use the following:650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/59/wKiom1X6neKQsS7LAAQKmVx2JC8032.jpg "style=" float: none; "title=" shell.jpg "alt=" Wkiom1x6nekqss7laaqkmvx2jc8032.jpg "/>650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/56/wKioL1X6oBvDKxhwAADLtW8inwM572.jpg "style=" float: none
% ' #mysql Table Cache State AmountMysql-u root-p123456-e ' SHOW/*!50000 GLOBAL * * STATUS like ' open% ' #mysql Thread Cache Hit Thread_cache_hits = (1-threads_created/connections) * 100% Normally, the thread cache hit rate is more than 90%. More reasonable.Mysql-u root-p123456-e ' SHOW/*!50000 GLOBAL * * STATUS like ' thread% ' #mysql Lock State: Lock State includes table lock and row lock, we can get the total number of locks through the system state variables, the number of times th
Shell scripts monitor Linux system nodes and service CPU memory performance
1. Obtain information
#! /Bin/bash # Description: # enter the top information into a file # Author: lone boat # version: 1.0 # Creation Time: 03: 04: 28 PATH =/bin: /sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin :~ /Binexport PATHp = 'pwd' Day = 'date + "% Y % m % d" 'host = 'hostname' for (I = 0; I
2. filter information
#
1. Create a monitoring scriptFirst, create an empty document in. Sh format under the folder.Enter a command under the root permission of the terminal to open the. Sh file and edit it.Sudo Vim /*/*...... /**. Sh // press the I key when editing the input in Vim. After editing, Press ESC to exit the edit option. Then, enter WQ IN THE uneditable state to save and exit.
// Shell scriptPID = 'pidof processname' // The quotation mark is not a single quotatio
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.