Пример #1
0
function hmib_check_upgrade()
{
    global $config, $database_default;
    include_once $config['library_path'] . '/database.php';
    include_once $config['library_path'] . '/functions.php';
    // Let's only run this check if we are on a page that actually needs the data
    $files = array('plugins.php', 'hmib.php');
    if (isset($_SERVER['PHP_SELF']) && !in_array(basename($_SERVER['PHP_SELF']), $files)) {
        return;
    }
    $version = plugin_hmib_version();
    $current = $version['version'];
    $old = db_fetch_cell("SELECT version FROM plugin_config WHERE directory='hmib'");
    if ($current != $old) {
        if (api_plugin_is_enabled('hmib')) {
            # may sound ridiculous, but enables new hooks
            api_plugin_enable_hooks('hmib');
        }
        db_execute("UPDATE plugin_config SET version='{$current}' WHERE directory='hmib'");
        db_execute("UPDATE plugin_config SET \n\t\t\tversion='" . $version['version'] . "', \n\t\t\tname='" . $version['longname'] . "', \n\t\t\tauthor='" . $version['author'] . "', \n\t\t\twebpage='" . $version['url'] . "' \n\t\t\tWHERE directory='" . $version['name'] . "' ");
        $columns = db_fetch_assoc('SHOW columns FROM plugin_hmib_hrSWRun_last_seen');
        foreach ($columns as $c) {
            $cols[] = $c[0];
        }
        if (!db_column_exists('plugin_hmib_hrSWRun_last_seen', 'total_time')) {
            db_execute("ALTER TABLE plugin_hmib_hrSWRun_last_seen ADD COLUMN `total_time` BIGINT unsigned not null default '0' AFTER `name`");
        }
    }
}
Пример #2
0
function display_help()
{
    $version = plugin_hmib_version();
    echo "Host MIB Associate OS Type, Version " . $version['version'] . ", " . COPYRIGHT_YEARS . "\n\n";
    echo "usage: call without any parameter\n";
}
Пример #3
0
function display_help()
{
    $version = plugin_hmib_version();
    echo "Host MIB Graph Automator, Version " . $version['version'] . ", " . COPYRIGHT_YEARS . "\n\n";
    echo "The Host MIB process that creates graphs for Cacti.\n\n";
    echo "usage: poller_graphs.php [-f] [-d]\n";
}
Пример #4
0
function display_help()
{
    $version = plugin_hmib_version();
    echo "Host MIB Poller Process, Version " . $version['version'] . ", " . COPYRIGHT_YEARS . "\n\n";
    echo "The main Host MIB poller process script for Cacti.\n\n";
    echo "usage: \n";
    echo "master process: poller_hmib.php [-M] [-f] [-fd] [-d]\n";
    echo "child  process: poller_hmib.php --host-id=N [--seed=N] [-f] [-d]\n\n";
}