2

我在 CentOS 6.5 上使用 Observium v​​0.14.4。一切都很好,配置好,我成功访问了软件(我正在使用 HTTPS 进行 Web 访问)。我正在遵循适用于 RHEL/CentOS [1] 的说明。

我正在尝试添加一个主机(“贝多芬”),它可以通过 Observium 机器(“mozart”)的 ping 和 fping 看到:

[user@mozart observium]$ sudo fping beethoven.example.com
beethoven.example.com is alive
[user@mozart observium]$ sudo ping -c2 beethoven.example.com
... (this works) ...
2 packets transmitted, 2 received, 0% packet loss, time 1001ms

但是,当我尝试使用添加贝多芬时,sudo ./add_device.php beethoven.example.com example v2c我得到:

Try to add beethoven.example.com:
Could not ping beethoven.example.com.
Devices skipped: 1.

Google 和 DDG 没有透露任何有用的解决方案。谢谢!

[1] http://www.observium.org/wiki/RHEL_Installation

4

2 回答 2

2

我遇到了同样的问题,当我检查 ping 代码时,这是因为它正在 /usr/bin 中寻找 fping 并且我的 fping 已安装到 /usr/sbin 中,所以我只是做了

ln -s /usr/sbin/fping /usr/bin/fping

您可以通过取消注释 contains/functions.php 中的第 619 行来启用 ping 调试

$ping_debug = TRUE; $file = '/tmp/pings_debug.log'; $time = date('Y-m-d H:i:s', time()); /// Uncomment this line for DEBUG isPingable()

这显示了这个日志

# cat pings_debug.log
2014-08-02 10:16:43 | PING ERROR: firewall (1) | FPING OUT: sh: /usr/bin/fping: No such file or directory
2014-08-02 10:16:43 | PING ERROR: firewall (2) | FPING OUT: sh: /usr/bin/fping: No such file or directory
2014-08-02 10:16:43 | PING ERROR: firewall (3) | FPING OUT: sh: /usr/bin/fping: No such file or directory
MTR OUT:
于 2014-08-02T10:22:02.113 回答
1

而不是符号链接(这可能会导致您的发行版的包管理器出现问题)尝试编辑您的 Observium 配置和工具的设置路径。

请参见此处:Observium:可执行文件的位置

$config['rrdtool']        = "/usr/bin/rrdtool";
$config['fping']          = "/usr/bin/fping";
$config['fping6']         = "/usr/bin/fping6";
$config['snmpwalk']       = "/usr/bin/snmpwalk";
$config['snmpget']        = "/usr/bin/snmpget";
$config['snmpbulkwalk']   = "/usr/bin/snmpbulkwalk";
$config['whois']          = "/usr/bin/whois";
$config['ping']           = "/bin/ping";
$config['mtr']            = "/usr/bin/mtr";
$config['nmap']           = "/usr/bin/nmap";
$config['nagios_plugins'] = "/usr/lib/nagios/plugins";
$config['ipmitool']       = "/usr/bin/ipmitool";
$config['virsh']          = "/usr/bin/virsh";
于 2015-05-26T09:09:16.767 回答