#!/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###############
#!/bin/sh#crontabusage:*/2****/home/http_restart.sh> >/backup/restart_apache.logmin_ram=3200free_ram= ' free-m|grepmem|awk ' {print $4} ' echo$ (date+ "%y-%m-%d") ' uptime ' if[ ' echo ' $FREE _ramThis article is from the "my operation and maintenance of the road" blog, declined reprint!Monitor HTTP process for high memory restart HTTPD
========================================================== ==========This article is the original khler, and the original author information and the original link of this article must be kept completely and completely reprinted.
Author: heyuanhuiE-mail:Khler@163.comQQ: 23381103MSN:Pragmac@hotmail.com========================================================== ==========
How can I ensure that the service is always running? How can I ensure automatic restart
Monitor the execution state of the. Py script with a Python script and implement an interrupt restart. #!/usr/bin/python#-*-coding:utf-8-*-importsubprocess,time,systime=10 #程序状态检测间隔 (units: minutes) cmd= "get_bjipku.py" #需要执行程序的绝对路径, support jar such as: D:\\calc.exe or D:\\test.jarclassauto_run (): def__init__ (self,sleep_time,cmd): self.sleep_time=sleep_time self.cmd=cmdself.ext = (cmd[-3:]). Lower (
Simple Solution for linux server process monitoring and automatic restart, linux Server Process Monitoring
Reprinted please indicate the source: curtain roll west wind column (http://blog.csdn.net/ljxfblog)
Starting from this week, the newbie game was in the file deletion an
In order to achieve a highly available based on the Apache web site environment, in Apache for a variety of reasons automatically stop running, want to immediately restore site access, this requires a tool to monitor the operation of Apache real-time and can automatically restart the HTTPD service, on the Internet to find relevant information, Rewrite the following simple monitoring and
Objective: Linux server programs will be dumped for various reasons, which will affect user usage. Here we provide a simple process monitoring and restart function.
Implementation principle: the script is called by the scheduled task crontab. The script uses PS to check whether the process exists. If not,
Linux shutdown and restart process analysis-general Linux technology-Linux programming and kernel information. The following is a detailed description. The shutdown and restart process
The shutdown and restart process in Linux is not important for general desktop applications and network servers, but it has some research significance in the User-Defined embedded system kernel, by understanding the process of Linux shutdown and
Linux shutdown and restart process is not important for general desktop applications and Web servers, but in the user's own definition of embedded system kernel has some research significance, by understanding the Linux shutdown restart
, the Linux operating system default shell is generally the Bourne Again shell, which is Bourne shell extension, called Bash,bash command syntax is a superset of Bourne shell command syntax, and in The Bourne shell adds and enhances a number of features on the base. Here, we use Bash as an example to summarize some of the things that the Shell uses to monitor system and
Monitor Linux system and process resources using Shell scripts
This article mainly introduces how to monitor Linux system and process resources by using Shell scripts. This article describes how to check whether a
/monitor.shdirectly when I set the command, I found that this configuration will not execute the shell script, before adding SH can be executed.Then we started writing monitor.sh this shell script.#! /bin/sh proc_name= "worldframe_d" #进程名 proc_num () #查询进程数量 { num= ' ps-ef | grep $proc _name | grep-v grep | Wc-l ' return $num}proc_num number=$? #获取进程数量if [$number-eq 0] #如果进程数量为0then #重新启动服务器, or ex
This article mainly introduces how to monitor Linux system and process resources by using Shell scripts. This article describes how to check whether a process exists, check the CPU usage of the Process, check the memory usage of the proc
Expert: how to monitor and protect process security in Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. By using user-level top, ps, and other system tools as well as Linux
protection is not logically desirable, although it is generally used in general scenarios. The problem is that P1 or P2 can be killed at any time. If one of them will not be killed, the problem will be solved. In Linux, The INIT process cannot be killed, so init can be used as the monitor. In fact, there is also a classic big loop in it, but people have the priv
Python is used to monitor linux performance and process consumption performance.
This article provides an example of how to monitor linux performance and process consumption performance using python. The specific implementation co
Linux system monitoring commands There are many, Pidstat command is one of them, using the Pidstat command can be used to monitor the Linux system process data, but first to install the Pidstat to use, The following small series for you to introduce the Linux installation 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.