查看服务是否启动以及杀掉进程,再启动进程的小技巧
首先查看服务是否启动
<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
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。