【问题标题】:Where does store pidfiles for filebeat and metricbeat in centos 7centos 7中filebeat和metricbeat的pidfiles在哪里存储
【发布时间】:2017-03-04 18:34:15
【问题描述】:

我需要为我的 filbeat/metricbeat 进程添加 monit 检查器。 我想通过pid文件查看进程,但是在centos 7中找不到系统存储这些文件的位置。

例如在我本地的 ubuntu 14.04 中,它存储在此路径下 /var/run/filebeat.pid/var/run/metricbeat.pid

我尝试在整个系统中查找文件(find / -name filebeat.pid),但我找不到。

如果没有为什么要通过pidfile检查,我还有其他方法可以检查进程状态吗?

任何建议都会有所帮助,在此先感谢)

【问题讨论】:

    标签: linux monit filebeat metricbeat


    【解决方案1】:

    首先使用可执行文件的名称获取进程 ID,例如filebeat/metricbeat 在你的情况下。

    这是一个搜索xinetd进程的例子 使用 pgrep 搜索您的进程:

    $ sudo pgrep xinetd
    1180
    

    1180 是 xinetd 进程的 PID。你可以像这样得到它的论点:

    $ cat /proc/1180/cmdline 
    /usr/sbin/xinetd-stayalive-pidfile/var/run/xinetd.pid
    

    如果这没有将 pidfile 指定为参数,您可以尝试 lsof 列出与进程 ID 关联的打开文件。

    $ sudo lsof -p <Process ID>
    

    【讨论】:

      猜你喜欢
      • 2011-01-10
      • 2011-06-24
      • 1970-01-01
      • 2014-11-22
      • 1970-01-01
      • 2020-02-05
      • 2013-07-23
      • 2012-01-27
      • 2013-10-22
      相关资源
      最近更新 更多