AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 505057
Accepted
Chris Kimpton
Chris Kimpton
Asked: 2013-05-05 12:50:00 +0800 CST2013-05-05 12:50:00 +0800 CST 2013-05-05 12:50:00 +0800 CST

Monit 5.5 绑定到本地主机,但应该在所有

  • 772

使用Centos 6.4,使用yum 安装Monit 5.5。

我有 2 台安装了 monit 的服务器 - 相同的版本,相同的配置 - 但一个绑定在所有地址上,另一个只绑定在本地主机上。

问题服务器:

# service monit restart
Stopping monit:                                            [  OK  ]
Starting monit: Starting monit daemon with http interface at [localhost:8080]
                                                           [  OK  ]

好的服务器:

# service monit restart
Stopping monit:                                            [  OK  ]
Starting monit: Starting monit daemon with http interface at [*:8080]
                                                           [  OK  ]

配置是这样的:

set httpd port 8080
  allow fofo:sdad
  allow fdgdfg:dsfsdf
  SSL ENABLE
  PEMFILE  /var/certs/monit.pem
  signature disable

我猜问题是问题服务器的一些网络配置错误 - 因此它无法绑定到外部端口 - 但其他东西工作正常 - http,ssh 等......

更新更多信息-感谢您的评论:问题框:

# rpm -qi monit
Name        : monit                        Relocations: (not relocatable)
Version     : 5.5                               Vendor: Dag Apt Repository, http://dag.wieers.com/apt/
Release     : 1.el6.rf                      Build Date: Wed 20 Mar 2013 02:09:54 PM WET
Install Date: Sat 04 May 2013 09:30:54 PM WEST      Build Host: lisse.hasselt.wieers.com
Group       : Applications/Internet         Source RPM: monit-5.5-1.el6.rf.src.rpm
Size        : 716992                           License: GPLv3
Signature   : DSA/SHA1, Wed 20 Mar 2013 03:59:25 PM WET, Key ID a20e52146b8d79e6
Packager    : Steve Huff <[email protected]>
URL         : http://mmonit.com/monit/
Summary     : Process monitor and restart utility
Description :
Monit is an utility for monitoring daemons or similar programs running on
a Unix system. It will start specified programs if they are not running
and restart programs not responding.

工作箱:

# rpm -qi monit
Name        : monit                        Relocations: (not relocatable)
Version     : 5.5                               Vendor: Dag Apt Repository, http://dag.wieers.com/apt/
Release     : 1.el6.rf                      Build Date: Wed 20 Mar 2013 02:09:54 PM WET
Install Date: Fri 22 Mar 2013 04:02:32 AM WET      Build Host: lisse.hasselt.wieers.com
Group       : Applications/Internet         Source RPM: monit-5.5-1.el6.rf.src.rpm
Size        : 716992                           License: GPLv3
Signature   : DSA/SHA1, Wed 20 Mar 2013 03:59:25 PM WET, Key ID a20e52146b8d79e6
Packager    : Steve Huff <[email protected]>
URL         : http://mmonit.com/monit/
Summary     : Process monitor and restart utility
Description :
Monit is an utility for monitoring daemons or similar programs running on
a Unix system. It will start specified programs if they are not running
and restart programs not responding.

/etc/hosts 在它们之间看起来非常相似,如下所示:

cat /etc/hosts
# Automatically generated by ptisp cloud
127.0.0.1       localhost
x.x.x.x             [hostname]

问题框:

# netstat -tln | grep ":8080"
tcp        0      0 127.0.0.1:8080              0.0.0.0:*                   LISTEN

工作箱:

# netstat -tln | grep ":8080"
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN

还运行了“ip addr”,它的输出在工作箱和非工作箱之间看起来非常相似。

更新 2

今晚刚刚将 M/monit 添加到混音中,这个框奇怪地出现了两次,一次是不活动的。我在想这是因为 m/monit 服务器无法 ping 客户端回来......

提前感谢您的任何想法。克里斯

linux
  • 2 2 个回答
  • 1616 Views

2 个回答

  • Voted
  1. Best Answer
    Sergey Vlasov
    2013-05-19T11:57:58+08:002013-05-19T11:57:58+08:00

    如果 Monit 行为与配置文件中写入的内容不匹配,一个可能的原因可能是 Monit 实际上使用了不同的配置文件。

    包中的/etc/rc.d/init.d/monit脚本monit-5.5-1.el6.rf启动时monit未指定配置文件名,因此 Monit 尝试在多个位置查找配置文件并使用找到的第一个。另一件重要的事情是这个包中的默认配置文件名与未修改的上游版本的 Monit 使用的不同 - 上游使用monitrc,但来自 RepoForge 的包使用monit.conf.

    用于配置文件的搜索顺序如下:

    1. ~/.monitrc在 Monit 的上游版本中,或者~/.monit.conf在 RepoForge 包中(使用启动用户的主目录monit;如果 Monit 从 init 脚本启动,则用户为root)。主目录是使用getpwuid(geteuid())(即从/etc/passwd或任何其他 NSS 数据库)读取的,而不是从HOME环境变量读取的。

    2. /etc/monitrc在 Monit 的上游版本中,或/etc/monit.conf在 RepoForge 包中。如果使用 RepoForge 包,/etc/monit.conf最初包含一个未注释的include行,这会导致 Monit 从/etc/monit.d目录中读取其他配置文件:

      include /etc/monit.d/*
      

      在上游源代码中,示例monitrc文件已将此行注释掉,因此默认情况下不使用其他配置文件。

      还要注意 RepoForge 包有一个安装后脚本:

      # Moving old style configuration file to conf standard location
      if [ -f /etc/monitrc ]; then
          mv -f /etc/monitrc /etc/monit.conf
      fi
      

      因此,如果该/etc/monitrc文件在软件包安装或升级之前存在,该文件将被重命名为/etc/monit.conf,并以静默方式覆盖它。

    3. $SYSCONFDIR/monitrc在 Monit 的上游版本中,编译源代码时传递给脚本$SYSCONFDIR的选项的值在哪里(这个选项的默认值是,与 Autoconf 生成的脚本一样,默认前缀是,所以配置文件名变成)。在 RepoForge 包中,此文件名变为,使其变得多余。--sysconfdir=...configure$prefix/etcconfigure/usr/local/usr/local/etc/monitrc/etc/monit.conf

    4. /usr/local/etc/monitrc在 Monit 的上游版本中,或/usr/local/etc/monit.conf在 RepoForge 包中。这里的/usr/local/etc目录是硬编码的,不依赖于任何configure选项。

    5. ./monitrc在 Monit 的上游版本中,或者./monit.conf在 RepoForge 包中(从 init 脚本启动时,当前目录很可能是/)。

    • 4
  2. Joel E Salas
    2013-05-19T10:56:51+08:002013-05-19T10:56:51+08:00

    检查~/.monit.conf不存在——这个位置/etc/monit.conf甚至在查找 root 之前就被搜索过。(Monit 的上游版本使用~/.monitrcand /etc/monitrc,但这个特定的包使用不同的配置文件名。)

    • 1

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve