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

本文发布时间: 2019-Mar-22
首先通过进程查看服务是否启动[root@mode etc]# ps -ef | grep nagiosnagios 3256 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3258 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3261 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3264 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3265 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3266 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3270 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3276 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3355 1 0 Mar21 ? 00:00:06 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfgnagios 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 来记住里面的启动命令[root@mode etc]# ps -ef | grep nagiosnagios 3256 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3258 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3261 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3264 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3265 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3266 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3270 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3276 3197 0 Mar21 ? 00:00:00 /usr/sbin/httpdnagios 3355 1 0 Mar21 ? 00:00:06 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfgnagios 9952 1 0 00:37 ? 00:00:00 /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d然后在杀掉进程pkill nrpe


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:09pm
栏目列表