grep - 请问监测linux服务关键进程主要是参考哪个值
迷茫
迷茫 2017-04-17 14:00:17
0
3
687

做一个服务器监控程序,需要监控核心进程,有几个疑问请教一下:

指令

ps -ef|grep -v  grep|grep redis

结果:
redis 20508 1 1 Jan21 ? 01:30:10 /usr/sbin/redis-server /etc/redis.conf

疑问
1.以上结果中哪个值(字段)可以作为进程监控的依据?
2.如果以上指令不能很好的监控,请问有什么更好的指令?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
伊谢尔伦

ps -ef|grep command is mainly to filter out whether the process you want to check is running, and it will return the process ID which can be used for subsequent operations;
The above results show:

  1. The redis process exists, that is, redis has been started and did not exit abnormally;

  2. The redis process number is 20508, you can kill it by kill 20508;

  3. This redis process is started through the /usr/sbin/redis-server file, and the configuration file used is /etc/redis.conf

  4. The start time of this redis process is Jan21 (January 21) 01:30:10

  5. This redis process is started using the ? account (the user is not displayed, only the ? number is displayed)

洪涛

Is the poster referring to the process ID?

刘奇

Looking at this can tell whether the process is dead or not, but there is not a lot of useful information

First think clearly about the purpose of your monitoring and which indicators can meet your purpose

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!