Пример #1
0
function snmpagent_global_settings_update()
{
    $mc = new MibCache();
    $mc->object('cactiApplVersion')->set(snmpagent_read('cactiApplVersion'));
    $mc->object('cactiApplSnmpVersion')->set(snmpagent_read('cactiApplSnmpVersion'));
    $mc->object('cactiApplRrdtoolVersion')->set(read_config_option("rrdtool_version", true));
    $mc->object('cactiApplPollerEnabled')->set(read_config_option("poller_enabled", true) == "on" ? 1 : 2);
    $mc->object('cactiApplPollerType')->set(read_config_option("poller_type", true));
    $mc->object('cactiApplPollerInterval')->set(read_config_option("poller_interval", true));
    $mc->object('cactiApplPollerMaxProcesses')->set(read_config_option("concurrent_processes", true));
    $mc->object('cactiApplPollerLoadBalance')->set(read_config_option("process_leveling", true) == "on" ? 1 : 2);
    $mc->object('cactiApplSpineMaxThreads')->set(read_config_option("max_threads", true));
    $mc->object('cactiApplSpineScriptServers')->set(read_config_option("php_servers", true));
    $mc->object('cactiApplSpineScriptTimeout')->set(read_config_option("script_timeout", true));
    $mc->object('cactiApplSpineMaxOids')->set(read_config_option("max_get_size", true));
    $mc->object('cactiApplLastUpdate')->set(time());
    /* update boost settings */
    $mc->mib('CACTI-BOOST-MIB');
    $mc->object('boostApplRrdUpdateEnabled')->set(read_config_option("boost_rrd_update_enable", true) == "on" ? 1 : 2);
    $mc->object('boostApplRrdUpdateInterval')->set(read_config_option("boost_rrd_update_interval", true));
    $mc->object('boostApplRrdUpdateMaxRecords')->set(read_config_option("boost_rrd_update_max_records", true));
    $mc->object('boostApplRrdUpdateMaxRecordsPerSelect')->set(read_config_option("boost_rrd_update_max_records_per_select", true));
    $mc->object('boostApplRrdUpdateMaxStringLength')->set(read_config_option("boost_rrd_update_string_length", true));
    $mc->object('boostApplRrdUpdatePollerMemLimit')->set(read_config_option("boost_poller_mem_limit", true));
    $mc->object('boostApplRrdUpdateMaxRunTime')->set(read_config_option("boost_rrd_update_max_runtime", true));
    $mc->object('boostApplRrdUpdateRedirect')->set(read_config_option("boost_redirect", true) == "on" ? 1 : 2);
    $mc->object('boostApplServerEnabled')->set(read_config_option("boost_server_enable", true) == "on" ? 1 : 2);
    $mc->object('boostApplServerMultiprocess')->set(read_config_option("boost_server_multiprocess", true) == "on" ? 1 : 2);
    $mc->object('boostApplServerHostname')->set(read_config_option("boost_server_hostname", true));
    $mc->object('boostApplServerListenPort')->set(read_config_option("boost_server_listen_port", true));
    $mc->object('boostApplServerTimeOuts')->set(read_config_option("boost_server_timeout", true));
    $mc->object('boostApplImageCacheEnabled')->set(read_config_option("boost_png_cache_enable", true) == "on" ? 1 : 2);
    $mc->object('boostApplLoggingEnabled')->set(read_config_option("path_boost_log", true) == true ? 1 : 2);
    $mc->object('boostApplLastUpdate')->set(time());
}