$db_version = get_db_version(); $db_version = sprintf("%03d", $db_version + 1); if (is_file($config['install_dir'] . "/update/{$db_version}.sql") || is_file($config['install_dir'] . "/update/{$db_version}.php")) { $notifications[] = array('text' => 'Your database schema is old and needs updating. Run from server console: <pre style="padding: 3px" class="small">' . $config['install_dir'] . '/discovery.php -u</pre>', 'severity' => 'alert'); } unset($db_version); // Check mysqli extension if (OBS_DB_EXTENSION != 'mysqli' && check_extension_exists('mysqli', '')) { $notifications[] = array('title' => 'Deprecated MySQL Extension', 'text' => 'The deprecated mysql extension is still in use, we recommend using mysqli.<br />To switch, add the following to your config.php: <pre>$config[\'db_extension\'] = \'mysqli\';</pre>', 'severity' => 'warning'); } //$notifications[] = array('text' => dbHostInfo(), 'severity' => 'debug'); // Warning about obsolete config on some pages if (OBS_DEBUG || in_array($vars['tab'], array('data', 'perf', 'edit', 'showtech')) || in_array($vars['page'], array('pollerlog', 'settings', 'preferences'))) { // FIXME move to notification center? print_obsolete_config(); } } if (isset($cache['maint']['count']) && $cache['maint']['count'] > 0) { $notifications[] = array('text' => '<h4>Scheduled Maintenance in Progress</h4>' . 'Some or all alert notifications have been suppressed due to a scheduled maintenance.', 'severity' => 'warning'); $alerts[] = array('text' => '<h4>Scheduled Maintenance in Progress</h4>' . 'Some or all alert notifications have been suppressed due to a scheduled maintenance.', 'severity' => 'warning'); } foreach ($alerts as $alert) { // FIXME handle severity parameter with colour or icon? echo '<div width="100%" class="alert alert-' . $alert['severity'] . '">'; if (isset($alert['title'])) { echo '<h4>' . $alert['title'] . '</h4>'; } echo $alert['text'] . '</div>'; } // Authenticated. Print a page.
include_once "includes/definitions.inc.php"; include "includes/functions.inc.php"; include "includes/discovery/functions.inc.php"; $scriptname = basename($argv[0]); $cli = TRUE; //if (is_cron()) { $options['q'] = TRUE; } // Set quiet for cron $start = utime(); $runtime_stats = array(); if (isset($options['V'])) { print_message(OBSERVIUM_PRODUCT . " " . OBSERVIUM_VERSION); exit; } if (!isset($options['q'])) { print_message("%g" . OBSERVIUM_PRODUCT . " " . OBSERVIUM_VERSION . "\n%WDiscovery%n\n", 'color'); // Warning about obsolete configs. if (print_obsolete_config()) { echo PHP_EOL; } } if (isset($options['h'])) { $params = array(); switch ($options['h']) { case 'odd': $options['n'] = 1; $options['i'] = 2; break; case 'even': $options['n'] = 0; $options['i'] = 2; break; case 'all':
* @copyright (C) 2006-2015 Adam Armstrong * */ chdir(dirname($argv[0])); include_once "includes/defaults.inc.php"; include_once "config.php"; $options = getopt("h:d"); include_once "includes/definitions.inc.php"; include "includes/functions.inc.php"; $scriptname = basename($argv[0]); $cli = TRUE; $localhost = get_localhost(); print_message("%g" . OBSERVIUM_PRODUCT . " " . OBSERVIUM_VERSION . "\n%W测试E-mail配置%n\n", 'color'); print_message("See mail backend options here: http://www.observium.org/wiki/Configuration_Options#Email_backend_settings\n"); // Warning about obsolete configs. if (print_obsolete_config('email')) { echo PHP_EOL; } if ($options['h']) { $params = array(); print_message("我的主机名: %g{$localhost}%n", 'color'); if (!strpos($localhost, '.')) { print_message(' %y主机名不是 FQDN%n, 这可能会在后台发送SMTP电子邮件时导致问题', 'color'); } /* // Convert obsolete config options to new. foreach (array('backend', 'from', 'sendmail_path', 'smtp_host', 'smtp_port', 'smtp_timeout', 'smtp_secure', 'smtp_auth', 'smtp_username', 'smtp_password') as $tmp_param) { if (isset($config['email_'.$tmp_param])) {