码迷,mamicode.com
首页 > 系统相关 > 详细

查看服务是否启动以及杀掉进程,再启动进程的小技巧

时间:2015-03-21 17:07:21      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

首先查看服务是否启动

<pre name="code" class="html">[root@mode etc]# ps -ef | grep nagios
nagios    3256  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3258  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3261  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3264  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3265  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3266  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3270  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3276  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3355     1  0 Mar21 ?        00:00:06 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios    9952     1  0 00:37 ?        00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

[root@mode etc]# netstat -lntActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:747 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:715 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:784 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:47614 0.0.0.0:* LISTEN tcp 0 0 :::80 :::* LISTEN tcp 0 0 :::22 :::* LISTEN [root@mode etc]# lsof -i tcp:5666COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEnrpe 9952 nagios 4u IPv4 66781 0t0 TCP *:5666 (LISTEN)


杀掉进程前:查看ps -ef|grep nagios 来记住里面的启动命令
<pre name="code" class="html">[root@mode etc]# ps -ef | grep nagios
nagios    3256  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3258  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3261  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3264  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3265  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3266  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3270  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3276  3197  0 Mar21 ?        00:00:00 /usr/sbin/httpd
nagios    3355     1  0 Mar21 ?        00:00:06 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios    9952     1  0 00:37 ?        00:00:00<span style="color:#ff0000;"> /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d</span>



然后在杀掉进程

pkill  nrpe



查看服务是否启动以及杀掉进程,再启动进程的小技巧

标签:

原文地址:http://blog.csdn.net/u014236541/article/details/44516863

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!