예제 #1
0
function add_graphs()
{
    global $config;
    /* check for summary changes first */
    $host_template = read_config_option('mikrotik_summary_host_template');
    $host_type_dq = read_config_option('mikrotik_dq_host_type');
    if (!empty($host_template)) {
        /* check to see if the template exists */
        debug('Host Template Set');
        if (db_fetch_cell("SELECT count(*) FROM host_template WHERE id={$host_template}")) {
            debug('Host Template Exists');
            $host_id = db_fetch_cell("SELECT id FROM host WHERE host_template_id={$host_template}");
            if (empty($host_id)) {
                debug('MikroTik Summary Device Not Found, Adding');
            } else {
                debug("Host Exists Hostname is '" . db_fetch_cell("SELECT description FROM host WHERE id={$host_id}") . "'");
            }
            add_summary_graphs($host_id, $host_template);
        } else {
            cacti_log('WARNING: Unable to find MikroTik Summary Host Template', true, 'MIKROTIK');
        }
    } else {
        cacti_log('NOTE: MikroTik Summary Host Template Not Specified', true, 'MIKROTIK');
    }
    add_host_based_graphs();
}
예제 #2
0
function add_graphs()
{
    global $config;
    /* check for summary changes first */
    $host_template = read_config_option("hmib_summary_host_template");
    $host_app_dq = read_config_option("hmib_dq_applications");
    $host_type_dq = read_config_option("hmib_dq_host_type");
    if (!empty($host_template)) {
        /* check to see if the template exists */
        debug("Host Template Set");
        if (db_fetch_cell("SELECT count(*) FROM host_template WHERE id={$host_template}")) {
            debug("Host Template Exists");
            $host_id = db_fetch_cell("SELECT id FROM host WHERE host_template_id={$host_template}");
            if (empty($host_id)) {
                debug("Host MIB Summary Device Not Found, Adding");
            } else {
                debug("Host Exists Hostname is '" . db_fetch_cell("SELECT description FROM host WHERE id={$host_id}") . "'");
            }
            add_summary_graphs($host_id, $host_template);
        } else {
            cacti_log("WARNING: Unable to find Host MIB Summary Host Template", true, "HMIB");
        }
    } else {
        cacti_log("NOTE: Host MIB Summary Host Template Not Specified", true, "HMIB");
    }
    add_host_based_graphs();
}
예제 #3
0
function add_graphs()
{
    global $config;
    /* check for summary changes first */
    $host_template = db_fetch_cell("SELECT id \n\t\tFROM host_template \n\t\tWHERE hash='7c13344910097cc599f0d0485305361d'");
    $host_app_dq = db_fetch_cell("SELECT id \n\t\tFROM snmp_query\n\t\tWHERE hash='6b0ef0fe7f1d85bbb6812801ca15a7c5'");
    $host_type_dq = db_fetch_cell("SELECT id \n\t\tFROM snmp_query \n\t\tWHERE hash='137aeab842986a76cf5bdef41b96c9a3'");
    if (!empty($host_template)) {
        /* check to see if the template exists */
        debug('Host Template Set');
        if (db_fetch_cell("SELECT count(*) FROM host_template WHERE id={$host_template}")) {
            debug('Host Template Exists');
            $host_id = db_fetch_cell("SELECT id FROM host WHERE host_template_id={$host_template}");
            if (empty($host_id)) {
                debug('Host MIB Summary Device Not Found, Adding');
            } else {
                debug("Host Exists Hostname is '" . db_fetch_cell("SELECT description FROM host WHERE id={$host_id}") . "'");
            }
            add_summary_graphs($host_id, $host_template);
        } else {
            cacti_log('WARNING: Unable to find Host MIB Summary Host Template', true, 'HMIB');
        }
    } else {
        cacti_log('NOTE: Host MIB Summary Host Template Not Specified', true, 'HMIB');
    }
    add_host_based_graphs();
}