crt monitor shell

Want to know crt monitor shell? we have a huge selection of crt monitor shell information on alibabacloud.com

Whether the shell script monitor is executing and automatically starts the process if it is not executed

Code inside the monitoring 1 processes, the code is very simple, I do not explain, there is not understand, you can ask in reply.I saw it and gave it a lecture.Of course, the script to execute, you need to turn on the system's timer process Crond, and edit the configuration file.Executive Crontab-eEnter */1 * * * */home/automonitor.sh to execute the script once a minute.[C-sharp]View PlainCopy #!/bin/sh Cdnclient_pid= ' ps-aux|grep-v ' grep ' |grep-c '/cdn_client_d ' Ulimit-c Unli

Shell: Monitor the running state of the process and automatically restart the process

#!/bin/Shmaxrstcount=5; Proctogo=/mnt/hgfs/code/test/Show#count isThe counter of test started Timescount=0Sys_reboot () {echo"system is going to reboot"; Reboot;} Main_loop () { while : Do######################################### prostillrunning=$ (Ps-aux |grep"${proctogo}"|grep-v"grep") if[-Z"$ProStillRunning" ]; Then #start test chmod+x ${proctogo} ${proctogo} fi #the running times counter let Count=count+1Echo"test running Times is $count"#wait fortest stoping ... sleep3###############

Shell Monitor lists 10 cpu-intensive processes in 1 hours

The script reads as follows:-------------------------------------------------------------------------------------------------------#!/bin/sh#定义变量secs=3600Unit_time=60stepts=$ (($secs/$unit _time))echo CPU usage ...;For ((i=0;iDoPs-eo COMM,PCPU | Tail-n +2 >>/tmp/cpu_usage.$$ #$$ indicates current process PID informationSleep $unit _timeDoneecho CPU Eaters:cat/tmp/cpu_usage.$$ | \awk ' {process[$1]+=$2}end{for (i in process) {printf ("%-20s%s\n", I,process[i])}} ' | \ #使用awk对收集结果进行统计分析SORT-NRK 2

Linux--shell Monitor Tomcat and automate reboots

#! /bin/sh#while: Dead Loop#doui=$ (PS x |grep Catalina |grep Tomcat |grep-v Grep|awk ' {print $} ')Echo ' Tomcat pid is ' $uiIf["$ui" = = ""]; thenecho "Tomcat is shutdown, now start up tomcat ...."#export java_home=/opt/jdk/1.6Export path= $JAVA _home/bin: $PATHExport LANG=ZH_CN. GB18030Export LANGUAGE=ZH_CN.GB18030:ZH_CN.GB2312:ZH_CN/home/tomcat6/bin/startup.shSleep 4Date >> Time.txtecho "' Date +%d/%m/%y:%h:%m:%s ', tomcat restart OK ..."Elseecho "Tomcat is running ...."Fi#doneThis article i

Shell script to monitor if the site is abnormal

The shell monitors the site for unusual script, such as an abnormal automatic email notification to the administrator. Process: 1. Check that the Http_code returned by the Web site is equal to 200, if not 200 as an exception. 2. Check Web site access time, more than Maxloadtime (10 seconds) as an exception. 3. Send notification email, in the/tmp/monitor_load.remark record send time, in an hour does not repeat, such as an hour after the empty/tmp/m

Linux/unix Shell Monitoring Oracle Instance (monitor instance)

Label:Using shell scripts to monitor and manage Oracle databases will greatly simplify the workload of DBAs, such as common monitoring of instances, monitoring of monitors, monitoring of alarm logs, backup of databases, automatic mailing of AWR report, etc. This article gives an example of using shell scripts to monitor

Use shell script to monitor if a process exists that does not exist the instance that is started

Use shell script to monitor whether a process exists without a startup instance, first on the code dry: #!/bin/shPs-fe|grep processstring |grep-v grepIf [$?-ne 0]Thenecho "START process ..."Elseecho "Runing ..."Fi#####Processstring represents a process feature string that can be queried to a unique process's character string0 indicates the existence of$? -ne 0 does not exist, $? -eq 0 Exists ---------------

MySQL monitor shell from library status

' |awk ' {print$2} ' cat_log= ' cat/tmp/shell/ Slave/slave.log|wc-l ' if[${slave_io}=yes];then echo "Slave_io_running:yes" ${test_time}>>/tmp/shell /slave/slave.logelseecho "Slave_IO_Running:No "${test_time}>>/tmp/shell/slave/slave.log/ Usr/local/sendemail/sendemail-v1.56/sendemail-f[emailprotected]-t[emaIlprotected]-xpxxx-ssmtp.163.com-xuxxx-utest-m slave_io_ru

Shell script case (iv) Use the free command to accurately monitor RAM utilization

Tags: mem linux shell Shell script Linux ops arppingingRequirements: Use the free command to accurately monitor RAM utilizationKnowledge: GREP,FREE,AWK,BCThe script is as follows[[emailprotected] scripts]# cat mem.sh #!/bin/bash-# free-m represents output in m units, and if the memory is large enough, you should use the-g parameter and the capacity is output in g

Shell scripts monitor system load, CPU, and memory usage

$} '#设置交换分区的告警值为20%swap_warn=0.20if (($swap _used! = 0)); Then#如果交换分区已被使用, calculates the percentage of the total of the current remaining swap partition free, in decimal notation, to complement an integer digit before the decimal point 0Swap_per= ' echo ' scale=2;b= $swap _free/$swap _total;if (length (b) ==scale (b)) print 0;print B "|BC"#当前剩余交换分区百分比与告警值进行比较 (1 is returned when the value is less than 20%, and 0 is returned if it is less than)swap_now= ' expr $swap _per \ #如果当前交换分区使用即剩余小于20% (

Shell script to monitor disk usage (local + remote)

Any partition used to 90% send a message to the specified recipient, to 95% on the subject of the message Warning (warning), instructions to send mail program email#!/bin/bash#Updated: 2008-03-03 PM by:leif ([email protected])Email=/usr/local/bin/email/bin/df-h >/tmp/df.txtUse= ' Df-h | Grep-o [0-9]*% | Grep-o ' [0-9]\+ 'For I in $USEDoif (($i > 95))Then$EAMIL-S "WARNING low disk space for $i" [e-mail protected] BreakFiif (($i > 90))Then$EMAIL-S "Low disk space for $i" [EMAIL protected] fiDone/b

Monitor traffic shell scripts

order of magnitudeif[[$RX-lt1024x768]]; ThenRX="${rx}b/s" elif[[$RX-GT1048576]]; ThenRX=$(Echo$RX |awk '{print $1/1048576 "MB/S"}') $STATUS="Busy" ElseRX=$(Echo$RX |awk '{print $1/1024 "kb/s"}') fi# To determine if the sending traffic is larger than the MB level, the MB units are displayed, otherwise the KB order of magnitudeif[[$TX-lt1024x768]]; ThenTX="${tx}b/s" elif[[$TX-GT1048576]]; ThenTX=$(Echo$TX |awk '{print $1/1048576 "MB/S"}') ElseTX=$(Echo$TX |awk '{print $1/1024 "kb

Shell script, how to monitor the MySQL database.

Label: [Email protected] wyb]#CatJkmysql #!/bin/Bash Status= '/etc/init.d/mysqld status|grepRunning|WC-l ' Process=`PS-ef |grepmysqld|grep-Vgrep|WC-l ' Port= ' Lsof-i:3306|grep-I. listen|WC-l ' MySQL-uroot-p'Test'-E"show databases;">/dev/NULL 2>/dev/NULLa=$?[$a-eq0] [$port-ne0] [$process-ne0] [$status-ne0 ] Echo "MySQL is running"||Echo "MySQL is not running"[ email protected] wyb]# bash Jkmysql MySQL is running [[email protected] wyb]# Shell scri

Total Pages: 4 1 2 3 4 Go to: Go

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.