1

我对 Observium 有疑问。在 CentOS 7 上,我安装了 Observium。在这台服务器上我也有 DirectAdmin 和 Wordpress。当我登录 webpanel Observium 时,Graphs 没有显示任何数据(nan)。 图表没有数据

<?php

## Check http://www.observium.org/docs/config_options/ for documentation of possible settings

## It's recommended that settings are edited in the web interface at /settings/ on your observium installation.
## Authentication and Database settings must be hardcoded here because they need to work before you can reach the web-based configuration interface

// Database config ---  This MUST be configured
$config['db_extension'] = 'mysqli';
$config['db_host']      = 'localhost';
$config['db_user']      = 'root';
$config['db_pass']      = '[MyPassword]';
$config['db_name']      = 'observium';

$config['ping'] = "/usr/sbin/ping";
$config['fping'] = "/usr/sbin/fping";

// Base directory
#$config['install_dir'] = "/opt/observium";

// Default community list to use when adding/discovering
$config['snmp']['community'] = array("public");

// Authentication Model
$config['auth_mechanism'] = "mysql";    // default, other options: ldap, http-auth, please see documentation for config help

// Enable alerter
// $config['poller-wrapper']['alerter'] = TRUE;

//$config['web_show_disabled'] = FALSE;    // Show or not disabled devices on major pages.

// Set up a default alerter (email to a single address)
//$config['email']['default']        = "user@your-domain";
//$config['email']['from']           = "Observium <observium@your-domain>";
//$config['email']['default_only']   = TRUE;

$config['enable_syslog']                = 1; // Enable Syslog

// End config.php

手动执行时没有看到任何错误:

cd /opt/observium && ./discovery.php -h all && ./poller.php -h all

我的 /etc/cron.d/observium 文件

33 */6 * * *   root    cd /opt/observium/ && ./discovery.php -h all >> /dev/null 2>&1
*/15 * * * *   root    cd /opt/observium/ && ./discovery.php -h new >> /dev/null 2>&1
*/15 * * * *   root    cd /opt/observium/ && ./poller.php -h all >> /dev/null 2>&1
4

2 回答 2

0

您使用了错误的轮询时间(15 分钟)。正确的轮询时间为 5 分钟。使用官方安装指南CentOS Cron中描述的 cron 条目:

# Run a complete discovery of all devices once every 6 hours
33  */6   * * *   root    /opt/observium/discovery.php -h all >> /dev/null 2>&1

# Run automated discovery of newly added devices every 5 minutes
*/5 *     * * *   root    /opt/observium/discovery.php -h new >> /dev/null 2>&1

# Run multithreaded poller wrapper every 5 minutes
*/5 *     * * *   root    /opt/observium/poller-wrapper.py >> /dev/null 2>&1
于 2019-10-10T22:02:43.067 回答
0

在我的情况下,安装可能有问题。Observium 在此处有错误Observium bugreport带有解释“完全按照手册再次安装”。用于安装信息的好页面是这个observium 安装指南

就我而言,问题是我有一个 observium 文件夹,其中包含 Documents 文件夹中的所有脚本以及html子文件夹到/opt/observium/html. 我通过对根据 observium 手册设置的整个observium文件夹进行符号化来解决这个问题 :/opt/observium/DocumentRoot/etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /opt/observium/html
    <FilesMatch \.php$>
      SetHandler application/x-httpd-php
    </FilesMatch>
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /opt/observium/html/>
            DirectoryIndex index.php
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Require all granted
    </Directory>
    ErrorLog  ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog  ${APACHE_LOG_DIR}/access.log combined
    ServerSignature On
</VirtualHost>
于 2020-07-02T10:13:13.103 回答