0
GROUP BY i.type_id');
/* Get RRDtool version */
$rrdtool_version = 'Unknown';
if ((file_exists(read_config_option('path_rrdtool'))) && ((function_exists('is_executable')) && (is_executable(read_config_option('path_rrdtool'))))) {
$out_array = array();
exec(cacti_escapeshellcmd(read_config_option('path_rrdtool')), $out_array);
if (sizeof($out_array) > 0) {
if (preg_match('/^RRDtool ([1-9]\.[0-9])/', $out_array[0], $m)) {
$rrdtool_version = 'rrd-'. $m[1] .'.x';
}
}
}
/* Get SNMP cli version */
if ((file_exists(read_config_option('path_snmpget'))) && ((function_exists('is_executable')) && (is_executable(read_config_option('path_snmpget'))))) {
$snmp_version = shell_exec(cacti_escapeshellcmd(read_config_option('path_snmpget')) . ' -V 2>&1');
}else{
$snmp_version = "" . __('NET-SNMP Not Installed or its paths are not set. Please install if you wish to monitor SNMP enabled devices.') . "";
}
/* Check RRDTool issues */
$rrdtool_error = '';
if ($rrdtool_version != read_config_option('rrdtool_version')) {
$rrdtool_error .= "
" . __('ERROR: Installed RRDTool version does not match configured version.
Please visit the %s and select the correct RRDTool Utility Version.', "" . __('Configuration Settings') . '') . "
";
}
$graph_gif_count = db_fetch_cell('SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2');
if ($graph_gif_count > 0) {
$rrdtool_error .= "
" . __('ERROR: RRDTool 1.2.x+ does not support the GIF images format, but %d" graph(s) and/or templates have GIF set as the image format.', $graph_gif_count) . '
';
}
/* Get spine version */
$spine_version = 'Unknown';
if ((file_exists(read_config_option('path_spine'))) && ((function_exists('is_executable')) && (is_executable(read_config_option('path_spine'))))) {
$out_array = array();
exec(read_config_option('path_spine') . ' --version', $out_array);
if (sizeof($out_array) > 0) {
$spine_version = $out_array[0];
}
}
/* ================= input validation ================= */
get_filter_request_var('tab', FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^([a-zA-Z]+)$/')));
/* ==================================================== */
/* present a tabbed interface */
$tabs = array(
'summary' => __('Summary'),
'database' => __('Database'),
'phpinfo' => __('PHP Info'),
);
/* set the default tab */
load_current_session_value('tab', 'sess_ts_tabs', 'summary');
$current_tab = get_nfilter_request_var('tab');
$header_label = __('Technical Support [%s]', $tabs[get_request_var('tab')]);
if (sizeof($tabs)) {
$i = 0;
/* draw the tabs */
print "
\n";
}
/* Display tech information */
html_start_box($header_label, '100%', '', '3', 'center', '');
if (get_request_var('tab') == 'summary') {
html_section_header(__('General Information'), 2);
form_alternate_row();
print '' . __('Date') . " | \n";
print '' . date('r') . " | \n";
form_end_row();
api_plugin_hook_function('custom_version_info');
form_alternate_row();
print '' . __('Cacti Version') . " | \n";
print '' . $config['cacti_version'] . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Cacti OS') . " | \n";
print '' . $config['cacti_server_os'] . " | \n";
form_end_row();
form_alternate_row();
print '' . __('RSA Fingerprint') . " | \n";
print '' . read_config_option('rsa_fingerprint') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('NET-SNMP Version') . " | \n";
print '' . $snmp_version . " | \n";
form_end_row();
form_alternate_row();
print '' . __('RRDTool Version') . " | \n";
print '' . $rrdtool_versions[$rrdtool_version] . ' ' . $rrdtool_error . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Devices') . " | \n";
print '' . number_format_i18n($host_count) . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Graphs') . " | \n";
print '' . number_format_i18n($graph_count) . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Data Sources') . " | \n";
print '';
$data_total = 0;
if (sizeof($data_count)) {
foreach ($data_count as $item) {
print $input_types[$item['type_id']] . ': ' . number_format_i18n($item['total']) . ' ';
$data_total += $item['total'];
}
print __('Total: %d', number_format_i18n($data_total));
}else{
print "0";
}
print " | \n";
form_end_row();
html_section_header(__('Poller Information'), 2);
form_alternate_row();
print "Interval | \n";
print '' . read_config_option('poller_interval') . " | \n";
if (file_exists(read_config_option('path_spine')) && $poller_options[read_config_option('poller_type')] == 'spine') {
$type = $spine_version;
} else {
$type = $poller_options[read_config_option('poller_type')];
}
form_end_row();
form_alternate_row();
print '' . __('Type') . " | \n";
print '' . $type . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Items') . " | \n";
print '';
$total = 0;
if (sizeof($poller_item)) {
foreach ($poller_item as $item) {
print __('Action[%s]', $item['action']) . ': ' . number_format_i18n($item['total']) . ' ';
$total += $item['total'];
}
print __('Total: %d', number_format_i18n($total));
}else{
print "" . __('No items to poll') . "";
}
print " | \n";
form_end_row();
form_alternate_row();
print '' . __('Concurrent Processes') . " | \n";
print '' . read_config_option('concurrent_processes') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Max Threads') . " | \n";
print '' . read_config_option('max_threads') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('PHP Servers') . " | \n";
print '' . read_config_option('php_servers') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Script Timeout') . " | \n";
print '' . read_config_option('script_timeout') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Max OID') . " | \n";
print '' . read_config_option('max_get_size') . " | \n";
form_end_row();
form_alternate_row();
print '' . __('Last Run Statistics') . " | \n";
print '' . read_config_option('stats_poller') . " | \n";
form_end_row();
html_section_header(__('System Memory'), 2);
$i = 0;
/* Get System Memory */
$memInfo = utilities_get_system_memory();
foreach($memInfo as $name => $value) {
if ($config['cacti_server_os'] == 'win32') {
form_alternate_row();
print "$name | \n";
print '' . number_format_i18n($value/1024, 2) . " MB | \n";
form_end_row();
}else{
switch($name) {
case 'SwapTotal':
case 'SwapFree':
case 'MemTotal':
case 'MemFree':
case 'Buffers':
case 'Active':
case 'Inactive':
form_alternate_row();
print "$name | \n";
print '' . number_format_i18n($value/1024/1024, 2) . " MB | \n";
form_end_row();
}
}
$i++;
}
print "\n";
form_end_row();
html_section_header(__('PHP Information'), 2);
form_alternate_row();
print "" . __('PHP Version') . " | \n";
if (version_compare(PHP_VERSION, '5.5.0') >= 0) {
print '' . PHP_VERSION . " | \n";
}else{
print '' . PHP_VERSION . "" . __('PHP Version 5.5.0+ is recommended due to strong password hashing support.') . " | \n";
}
form_end_row();
form_alternate_row();
print "" . __('PHP OS') . " | \n";
print '' . PHP_OS . " | \n";
form_end_row();
form_alternate_row();
print "" . __('PHP uname') . " | \n";
print '';
if (function_exists('php_uname')) {
print php_uname();
}else{
print __('N/A');
}
print " | \n";
form_end_row();
form_alternate_row();
print "" . __('PHP SNMP') . " | \n";
print '';
if (function_exists('snmpget')) {
print __('Installed');
} else {
print __('Not Installed');
}
print " | \n";
form_end_row();
form_alternate_row();
print "max_execution_time | \n";
print '' . ini_get('max_execution_time') . " | \n";
form_end_row();
form_alternate_row();
print "memory_limit | \n";
print '' . ini_get('memory_limit');
/* Calculate memory suggestion based off of data source count */
$memory_suggestion = $data_total * 32768;
/* Set minimum - 16M */
if ($memory_suggestion < 16777216) {
$memory_suggestion = 16777216;
}
/* Set maximum - 512M */
if ($memory_suggestion > 536870912) {
$memory_suggestion = 536870912;
}
/* Suggest values in 8M increments */
$memory_suggestion = round($memory_suggestion / 8388608) * 8388608;
if (memory_bytes(ini_get('memory_limit')) < $memory_suggestion) {
print " ";
if ((ini_get('memory_limit') == -1)) {
print __("You've set memory limit to 'unlimited'.") . " ";
}
print __('It is highly suggested that you alter you php.ini memory_limit to %s or higher.', memory_readable($memory_suggestion)) . ' ' .
__('This suggested memory value is calculated based on the number of data source present and is only to be used as a suggestion, actual values may vary system to system based on requirements.');
print ' ';
}
print " | \n";
form_end_row();
utilities_get_mysql_recommendations();
}elseif (get_request_var('tab') == 'database') {
html_section_header(__('MySQL Table Information - Sizes in KBytes'), 2);
form_alternate_row();
print " ";
if (sizeof($tables) > 0) {
print "\n";
print "\n";
print "\n";
print "\n";
foreach ($tables as $table) {
form_alternate_row();
print '| ' . $table['TABLE_NAME'] . " | \n";
print '' . $table['ENGINE'] . " | \n";
print '' . number_format_i18n($table['TABLE_ROWS']) . " | \n";
print '' . number_format_i18n($table['AVG_ROW_LENGTH']/1024) . " | \n";
print '' . number_format_i18n($table['DATA_LENGTH']/1024) . " | \n";
print '' . number_format_i18n($table['INDEX_LENGTH']/1024) . " | \n";
print '' . $table['TABLE_COLLATION'] . " | \n";
print '' . $table['TABLE_COMMENT'] . " | \n";
form_end_row();
}
print " \n";
}else{
print __('Unable to retrieve table status');
}
print " | \n";
form_end_row();
}else{
html_section_header(__('PHP Module Information'), 2);
form_alternate_row();
$php_info = str_replace('width="600"', '', $php_info);
$php_info = str_replace('th colspan="2"', 'th class="subHeaderColumn"', $php_info);
print "" . $php_info . " | \n";
form_end_row();
}
html_end_box();
?>
array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'filter' => array(
'filter' => FILTER_CALLBACK,
'pageset' => true,
'default' => '',
'options' => array('options' => 'sanitize_search_string')
),
'sort_column' => array(
'filter' => FILTER_CALLBACK,
'default' => 'time',
'options' => array('options' => 'sanitize_search_string')
),
'sort_direction' => array(
'filter' => FILTER_CALLBACK,
'default' => 'ASC',
'options' => array('options' => 'sanitize_search_string')
),
'username' => array(
'filter' => FILTER_CALLBACK,
'default' => '-1',
'options' => array('options' => 'sanitize_search_string')
),
'result' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
)
);
validate_store_request_vars($filters, 'sess_userlog');
/* ================= input validation ================= */
if (get_request_var('rows') == '-1') {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
?>
|
|
array(__('User'), 'ASC'),
'full_name' => array(__('Full Name'), 'ASC'),
'realm' => array(__('Authentication Realm'), 'ASC'),
'time' => array(__('Date'), 'ASC'),
'result' => array(__('Result'), 'DESC'),
'ip' => array(__('IP Address'), 'DESC')
);
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), 1, 'utilities.php?action=view_user_log');
if (sizeof($user_log)) {
foreach ($user_log as $item) {
form_alternate_row('', true);
?>
|
|
|
|
|
|
1) {
db_execute_prepared('DELETE FROM user_log WHERE username = ? AND result = 1 ORDER BY time LIMIT ' . ($total_rows - 1), array($user['username']));
}
db_execute_prepared('DELETE FROM user_log WHERE username = ? AND result = 0', array($user['username']));
}
/* delete inactive users */
db_execute('DELETE FROM user_log WHERE user_id NOT IN (SELECT id FROM user_auth) OR username NOT IN (SELECT username FROM user_auth)');
}
}
function utilities_view_logfile() {
global $log_tail_lines, $page_refresh_interval, $refresh, $config;
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
$logfile = $config['base_path'] . '/log/cacti.log';
}
/* helps determine output color */
$linecolor = True;
/* ================= input validation and session storage ================= */
$filters = array(
'tail_lines' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'rfilter' => array(
'filter' => FILTER_VALIDATE_IS_REGEX,
'pageset' => true,
'default' => ''
),
'message_type' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'reverse' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '1'
),
'refresh' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => read_config_option('log_refresh_interval')
)
);
validate_store_request_vars($filters, 'sess_log');
/* ================= input validation ================= */
if (get_request_var('rows') == '-1') {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
$refresh['seconds'] = get_request_var('refresh');
$refresh['page'] = 'utilities.php?action=view_logfile&header=false';
top_header();
?>
|
|
0) {
$start_string = __('Log File [Total Lines: %d - Non-Matching Items Hidden]', sizeof($logcontents));
}else{
$start_string = __('Log File [Total Lines: %d - All Items Shown]', sizeof($logcontents));
}
html_start_box($start_string, '100%', '', '3', 'center', '');
$i = 0;
$j = 0;
$linecolor = false;
foreach ($logcontents as $item) {
$host_start = strpos($item, 'Device[');
$ds_start = strpos($item, 'DS[');
$new_item = '';
if ((!$host_start) && (!$ds_start)) {
$new_item = htmlspecialchars($item);
}else{
while ($host_start) {
$host_end = strpos($item, ']', $host_start);
$host_id = substr($item, $host_start+7, $host_end-($host_start+7));
$new_item = $new_item . htmlspecialchars(substr($item, 0, $host_start + 7)) . "" . htmlspecialchars(substr($item, $host_start + 7, $host_end-($host_start + 7))) . '';
$item = substr($item, $host_end);
$host_start = strpos($item, 'Device[');
}
$ds_start = strpos($item, 'DS[');
while ($ds_start) {
$ds_end = strpos($item, ']', $ds_start);
$ds_id = substr($item, $ds_start+3, $ds_end-($ds_start+3));
$new_item = $new_item . htmlspecialchars(substr($item, 0, $ds_start + 3)) . "" . htmlspecialchars(substr($item, $ds_start + 3, $ds_end-($ds_start + 3))) . '';
$item = substr($item, $ds_end);
$ds_start = strpos($item, 'DS[');
}
$new_item = $new_item . htmlspecialchars($item);
}
/* get the background color */
if ((substr_count($new_item, 'ERROR')) || (substr_count($new_item, 'FATAL'))) {
$class = 'clogError';
}elseif (substr_count($new_item, 'WARN')) {
$class = 'clogWarning';
}elseif (substr_count($new_item, ' SQL ')) {
$class = 'clogSQL';
}elseif (substr_count($new_item, 'DEBUG')) {
$class = 'clogDebug';
}elseif (substr_count($new_item, 'STATS')) {
$class = 'clogStats';
}else{
if ($linecolor) {
$class = 'odd';
}else{
$class = 'even';
}
$linecolor = !$linecolor;
}
print "| " . $new_item . " |
\n";
$j++;
$i++;
if ($j > 1000) {
print "| >>>>" . __('LINE LIMIT OF 1000 LINES REACHED!!') . "<<<< |
\n";
break;
}
}
html_end_box();
bottom_footer();
}
function utilities_clear_logfile() {
load_current_session_value('refresh', 'sess_logfile_refresh', read_config_option('log_refresh_interval'));
$refresh['seconds'] = get_request_var('refresh');
$refresh['page'] = 'utilities.php?action=view_logfile&header=false';
top_header();
$logfile = read_config_option('path_cactilog');
if ($logfile == '') {
$logfile = './log/cacti.log';
}
html_start_box(__('Clear Cacti Log File'), '100%', '', '3', 'center', '');
if (file_exists($logfile)) {
if (is_writable($logfile)) {
$timestamp = date('Y-m-d H:i:s');
$log_fh = fopen($logfile, 'w');
fwrite($log_fh, __('%s - WEBUI: Cacti Log Cleared from Web Management Interface.', $timestamp) . "\n");
fclose($log_fh);
print '| ' . __('Cacti Log File Cleared') . ' |
';
}else{
print "| " . __('Error: Unable to clear log, no write permissions.') . " |
";
}
}else{
print "| " . __('Error: Unable to clear log, file does not exist.'). " |
";
}
html_end_box();
}
function utilities_view_snmp_cache() {
global $poller_actions, $item_rows;
/* ================= input validation and session storage ================= */
$filters = array(
'rows' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'filter' => array(
'filter' => FILTER_CALLBACK,
'pageset' => true,
'default' => '',
'options' => array('options' => 'sanitize_search_string')
),
'host_id' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'snmp_query_id' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'poller_action' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
)
);
validate_store_request_vars($filters, 'sess_usnmp');
/* ================= input validation ================= */
if (get_request_var('rows') == '-1') {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
$refresh['seconds'] = '300';
$refresh['page'] = 'utilities.php?action=view_snmp_cache&header=false';
?>
|
|
|
|
|
|
|
|
array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'filter' => array(
'filter' => FILTER_CALLBACK,
'pageset' => true,
'default' => '',
'options' => array('options' => 'sanitize_search_string')
),
'sort_column' => array(
'filter' => FILTER_CALLBACK,
'default' => 'data_template_data.name_cache',
'options' => array('options' => 'sanitize_search_string')
),
'sort_direction' => array(
'filter' => FILTER_CALLBACK,
'default' => 'ASC',
'options' => array('options' => 'sanitize_search_string')
),
'host_id' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'poller_action' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
)
);
validate_store_request_vars($filters, 'sess_poller');
/* ================= input validation ================= */
if (get_request_var('rows') == '-1') {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
$refresh['seconds'] = '300';
$refresh['page'] = 'utilities.php?action=view_poller_cache&header=false';
?>
|
|
array(__('Data Source Name'), 'ASC'),
'nosort' => array(__('Details'), 'ASC'));
html_header_sort($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), 1, 'utilities.php?action=view_poller_cache');
$i = 0;
if (sizeof($poller_cache)) {
foreach ($poller_cache as $item) {
if ($i % 2 == 0) {
$class = 'odd';
}else{
$class = 'even';
}
print "\n";
?>
|
|
|
\n";
?>
|
|
'>
|
|
'>
|
|
'>
|
|
'>
|
|
'>
|
|
'>
|
|
'>
|
|
'>/a>
|
|
'>
|
|
'>
|
|
'>
|
|
'>
|
|
' . __('WARNING:') . '' . __('Can not open directory');
$cache_files = '' . __('WARNING:') . ' ' . __('Unknown');
}
}else{
$directory_size = '' . __('WARNING:') . ' ' . __('Directory Does NOT Exist!!');
$cache_files = '' . __('WARNING:') . ' ' . __('N/A');
}
$i = 0;
/* boost status display */
html_section_header(__('Current Boost Status'), 2);
form_alternate_row();
print '' . __('Boost On Demand Updating:') . ' | ' . ($rrd_updates == '' ? 'Disabled' : $boost_status_text) . ' | ';
form_alternate_row();
print '' . __('Total Data Sources:') . ' | ' . number_format_i18n($total_data_sources) . ' | ';
if ($total_records) {
form_alternate_row();
print '' . __('Pending Boost Records:') . ' | ' . number_format_i18n($pending_records) . ' | ';
form_alternate_row();
print '' . __('Archived Boost Records:') . ' | ' . number_format_i18n($arch_records) . ' | ';
form_alternate_row();
print '' . __('Total Boost Records:') . ' | ' . number_format_i18n($total_records) . ' | ';
}
/* boost status display */
html_section_header(__('Boost Storage Statistics'), 2);
/* describe the table format */
form_alternate_row();
print '' . __('Database Engine:') . ' | ' . $engine . ' | ';
/* tell the user how big the table is */
form_alternate_row();
print '' . __('Current Boost Tables Size:') . ' | ' . boost_file_size_display($data_length, 2) . ' | ';
/* tell the user about the average size/record */
form_alternate_row();
print '' . __('Avg Bytes/Record:') . ' | ' . boost_file_size_display($avg_row_length) . ' | ';
/* tell the user about the average size/record */
$output_length = read_config_option('boost_max_output_length');
if (strlen($output_length)) {
$parts = explode(':', $output_length);
if ((time()-1200) > $parts[0]) {
$refresh = TRUE;
}else{
$refresh = FALSE;
}
}else{
$refresh = TRUE;
}
if ($refresh) {
if (strcmp($engine, 'MEMORY') == 0) {
$max_length = db_fetch_cell('SELECT MAX(LENGTH(output)) FROM poller_output_boost');
}else{
$max_length = '0';
}
db_execute("REPLACE INTO settings (name, value) VALUES ('boost_max_output_length', '" . time() . ':' . $max_length . "')");
}else{
$max_length = $parts[1];
}
if ($max_length != 0) {
form_alternate_row();
print '' . __('Max Record Length:') . ' | ' . __('%d Bytes', number_format_i18n($max_length)) . ' | ';
}
/* tell the user about the "Maximum Size" this table can be */
form_alternate_row();
if (strcmp($engine, 'MEMORY')) {
$max_table_allowed = __('Unlimited');
$max_table_records = __('Unlimited');
}else{
$max_table_allowed = boost_file_size_display($max_data_length, 2);
$max_table_records = number_format_i18n(($avg_row_length ? round($max_data_length/$avg_row_length, 0) : 0));
}
print '' . __('Max Allowed Boost Table Size:') . ' | ' . $max_table_allowed . ' | ';
/* tell the user about the estimated records that "could" be held in memory */
form_alternate_row();
print '' . __('Estimated Maximum Records:') . ' | ' . $max_table_records . ' Records | ';
/* boost last runtime display */
html_section_header(__('Runtime Statistics'), 2);
form_alternate_row();
print '' . __('Last Start Time:') . ' | ' . $last_run_time . ' | ';
form_alternate_row();
print '' . __('Last Run Duration:') . ' | ';
print (($boost_last_run_duration > 60) ? __('%d minutes', (int)($boost_last_run_duration/60)) : '' ) . __('%d seconds', $boost_last_run_duration%60);
if ($rrd_updates != ''){ print ' (' . __('%0.2f percent of update frequency', round(100*$boost_last_run_duration/$update_interval/60));}
print ' | ';
form_alternate_row();
print '' . __('RRD Updates:') . ' | ' . $boost_rrds_updated . ' | ';
form_alternate_row();
print '' . __('Peak Poller Memory:') . ' | ' . ((read_config_option('boost_peak_memory') != '') ? (round(read_config_option('boost_peak_memory')/1024/1024,2)) . ' ' . __('MBytes') : __('N/A')) . ' | ';
form_alternate_row();
print '' . __('Detailed Runtime Timers:') . ' | ' . (($detail_stats != '') ? $detail_stats:__('N/A')) . ' | ';
form_alternate_row();
print '' . __('Max Poller Memory Allowed:') . ' | ' . ((read_config_option('boost_poller_mem_limit') != '') ? (read_config_option('boost_poller_mem_limit')) . ' ' . __('MBytes') : __('N/A')) . ' | ';
/* boost runtime display */
html_section_header(__('Run Time Configuration'), 2);
form_alternate_row();
print '' . __('Update Frequency:') . ' | ' . ($rrd_updates == '' ? __('N/A') : $boost_refresh_interval[$update_interval]) . ' | ';
form_alternate_row();
print '' . __('Next Start Time:') . ' | ' . $next_run_time . ' | ';
form_alternate_row();
print '' . __('Maximum Records:') . ' | ' . $max_records . ' ' . __('Records') . ' | ';
form_alternate_row();
print '' . __('Maximum Allowed Runtime:') . ' | ' . $boost_max_runtime[$max_runtime] . ' | ';
/* boost caching */
html_section_header(__('Image Caching'), 2);
form_alternate_row();
print '' . __('Image Caching Status:') . ' | ' . ($boost_cache == '' ? __('Disabled') : __('Enabled')) . ' | ';
form_alternate_row();
print '' . __('Cache Directory:') . ' | ' . $cache_directory . ' | ';
form_alternate_row();
print '' . __('Cached Files:') . ' | ' . $cache_files . ' | ';
form_alternate_row();
print '' . __('Cached Files Size:') . ' | ' . $directory_size . ' | ';
html_end_box(TRUE);
}
/**
*
*
* snmpagent_utilities_run_cache()
*
* @param mixed
* @return
*/
function snmpagent_utilities_run_cache() {
global $item_rows;
get_filter_request_var('mib', FILTER_CALLBACK, array('options' => 'sanitize_search_string'));
$mibs = db_fetch_assoc('SELECT DISTINCT mib FROM snmpagent_cache');
$registered_mibs = array();
if($mibs && $mibs >0) {
foreach($mibs as $mib) { $registered_mibs[] = $mib['mib']; }
}
/* ================= input validation ================= */
if(!in_array(get_request_var('mib'), $registered_mibs) && get_request_var('mib') != '-1' && get_request_var('mib') != '') {
die_html_input_error();
}
/* ==================================================== */
/* ================= input validation and session storage ================= */
$filters = array(
'rows' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'filter' => array(
'filter' => FILTER_CALLBACK,
'pageset' => true,
'default' => '',
'options' => array('options' => 'sanitize_search_string')
),
'mib' => array(
'filter' => FILTER_CALLBACK,
'default' => '-1',
'options' => array('options' => 'sanitize_search_string')
)
);
validate_store_request_vars($filters, 'sess_snmpac');
/* ================= input validation ================= */
if (get_request_var('rows') == -1) {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
?>
|
|
' . $name . '';
}else {
print "$name | ";
}
form_selectable_cell($mib, $item['oid']);
form_selectable_cell($item['kind'], $item['oid']);
form_selectable_cell($max_access, $item['oid']);
form_selectable_cell((in_array($item['kind'], array(__('Scalar'), __('Column Data'))) ? $item['value'] : __('N/A')), $item['oid']);
form_end_row();
}
}
html_end_box();
if (sizeof($snmp_cache)) {
print $nav;
}
?>
'LOW',
SNMPAGENT_EVENT_SEVERITY_MEDIUM => 'MEDIUM',
SNMPAGENT_EVENT_SEVERITY_HIGH => 'HIGH',
SNMPAGENT_EVENT_SEVERITY_CRITICAL => 'CRITICAL'
);
$severity_colors = array(
SNMPAGENT_EVENT_SEVERITY_LOW => '#00FF00',
SNMPAGENT_EVENT_SEVERITY_MEDIUM => '#FFFF00',
SNMPAGENT_EVENT_SEVERITY_HIGH => '#FF0000',
SNMPAGENT_EVENT_SEVERITY_CRITICAL => '#FF00FF'
);
$receivers = db_fetch_assoc('SELECT DISTINCT manager_id, hostname
FROM snmpagent_notifications_log
INNER JOIN snmpagent_managers
ON snmpagent_managers.id = snmpagent_notifications_log.manager_id');
/* ================= input validation ================= */
get_filter_request_var('receiver');
if(!in_array(get_request_var('severity'), array_keys($severity_levels)) && get_request_var('severity') != '-1' && get_request_var('severity') != '') {
die_html_input_error();
}
/* ==================================================== */
if (isset_request_var('purge')) {
db_execute('TRUNCATE table snmpagent_notifications_log');
/* reset filters */
set_request_var('clear', true);
}
/* ================= input validation and session storage ================= */
$filters = array(
'rows' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'page' => array(
'filter' => FILTER_VALIDATE_INT,
'default' => '1'
),
'filter' => array(
'filter' => FILTER_CALLBACK,
'pageset' => true,
'default' => '',
'options' => array('options' => 'sanitize_search_string')
),
'severity' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
),
'receiver' => array(
'filter' => FILTER_VALIDATE_INT,
'pageset' => true,
'default' => '-1'
)
);
validate_store_request_vars($filters, 'sess_snmpl');
/* ================= input validation ================= */
if (get_request_var('rows') == -1) {
$rows = read_config_option('num_rows_table');
}else{
$rows = get_request_var('rows');
}
?>
|
|
";
print "" . date('Y-m-d H:i:s', $item['time']) . ' | ';
print '' . htmlspecialchars($item['hostname'], ENT_QUOTES) . ' | ';
if($item['description']) {
print '' . htmlspecialchars($item['notification']) . ' | ';
}else {
print '' . htmlspecialchars($item['notification']) . ' | ';
}
print "$varbinds | ";
form_end_row();
}
}else{
print '| ' . __('No SNMP Notification Log Entries') . ' |
';
}
html_end_box();
if (sizeof($logs)) {
print $nav;
}
?>