/', '', $php_info); $php_info = preg_replace('/\<\/body\>.*$/', '', $php_info); $php_info = preg_replace('/\/U', '', $php_info); $php_info = preg_replace('/\<\/a\>/', '
', $php_info); $php_info = preg_replace('/\/U', '', $php_info); $php_info = preg_replace('/\<\/?address\>/', '', $php_info); return $php_info; } function memory_bytes($val) { $val = trim($val); $last = strtolower($val{strlen($val)-1}); switch($last) { // The 'G' modifier is available since PHP 5.1.0 case 'g': $val *= 1024; case 'm': $val *= 1024; case 'k': $val *= 1024; } return $val; } function memory_readable($val) { if ($val < 1024) { $val_label = 'bytes'; }elseif ($val < 1048576) { $val_label = 'K'; $val /= 1024; }elseif ($val < 1073741824) { $val_label = 'M'; $val /= 1048576; }else{ $val_label = 'G'; $val /= 1073741824; } return $val . $val_label; } function utilities_view_tech($php_info = '') { global $database_default, $config, $rrdtool_versions, $poller_options, $input_types; /* Get table status */ $tables = db_fetch_assoc('SHOW TABLES'); $skip_tables = array(); $table_status = array(); if (sizeof($tables)) { foreach($tables as $table) { $create_syntax = db_fetch_row('SHOW CREATE TABLE ' . $table['Tables_in_' . $database_default]); if (sizeof($create_syntax)) { if (substr_count(strtoupper($create_syntax['Create Table']), 'INNODB')) { $skip_tables[] = $table['Tables_in_' . $database_default]; }else{ $include_tables[] = $table['Tables_in_' . $database_default]; } } } } if (sizeof($include_tables)) { foreach($include_tables as $table) { $status = db_fetch_row("SHOW TABLE STATUS LIKE '$table'"); array_push($table_status, $status); } } /* Get poller stats */ $poller_item = db_fetch_assoc('SELECT action, count(action) AS total FROM poller_item GROUP BY action'); /* Get system stats */ $host_count = db_fetch_cell('SELECT COUNT(*) FROM host'); $graph_count = db_fetch_cell('SELECT COUNT(*) FROM graph_local'); $data_count = db_fetch_assoc('SELECT i.type_id, COUNT(i.type_id) AS total FROM data_template_data AS d, data_input AS i WHERE d.data_input_id = i.id AND local_data_id <> 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 Configuration Settings and select the correct RRDTool Utility Version.

"; } $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 " . $graph_gif_count . ' graph(s) and/or templates have GIF set as the image format.
'; } /* 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]; } } /* Display tech information */ html_start_box('Technical Support', '100%', '', '3', 'center', ''); html_header(array('General Information'), 2); print "\n"; print " Date\n"; print " " . date('r') . "\n"; print "\n"; api_plugin_hook_function('custom_version_info'); print "\n"; print " Cacti Version\n"; print " " . $config['cacti_version'] . "\n"; print "\n"; print "\n"; print " Cacti OS\n"; print " " . $config['cacti_server_os'] . "\n"; print "\n"; print "\n"; print " RSA Fingerprint\n"; print " " . read_config_option('rsa_fingerprint') . "\n"; print "\n"; print "\n"; print " NET-SNMP Version\n"; print " " . $snmp_version . "\n"; print "\n"; print "\n"; print " RRDTool Version\n"; print " " . $rrdtool_versions[$rrdtool_version] . ' ' . $rrdtool_error . "\n"; print "\n"; print "\n"; print " Devices\n"; print " " . $host_count . "\n"; print "\n"; print "\n"; print " Graphs\n"; print " " . $graph_count . "\n"; print "\n"; print "\n"; print " Data Sources\n"; print " "; $data_total = 0; if (sizeof($data_count)) { foreach ($data_count as $item) { print $input_types[$item['type_id']] . ': ' . $item['total'] . '
'; $data_total += $item['total']; } print 'Total: ' . $data_total; }else{ print "0"; } print "\n"; print "\n"; html_header(array('Poller Information'), 2); print "\n"; 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')]; } print "\n"; print "\n"; print " Type\n"; print " " . $type . "\n"; print "\n"; print "\n"; print " Items\n"; print " "; $total = 0; if (sizeof($poller_item)) { foreach ($poller_item as $item) { print 'Action[' . $item['action'] . ']: ' . $item['total'] . '
'; $total += $item['total']; } print 'Total: ' . $total; }else{ print "No items to poll"; } print "\n"; print "\n"; print "\n"; print " Concurrent Processes\n"; print " " . read_config_option('concurrent_processes') . "\n"; print "\n"; print "\n"; print " Max Threads\n"; print " " . read_config_option('max_threads') . "\n"; print "\n"; print "\n"; print " PHP Servers\n"; print " " . read_config_option('php_servers') . "\n"; print "\n"; print "\n"; print " Script Timeout\n"; print " " . read_config_option('script_timeout') . "\n"; print "\n"; print "\n"; print " Max OID\n"; print " " . read_config_option('max_get_size') . "\n"; print "\n"; print "\n"; print " Last Run Statistics\n"; print " " . read_config_option('stats_poller') . "\n"; print "\n"; html_header(array('PHP Information'), 2); print "\n"; 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"; } print "\n"; print "\n"; print " PHP OS\n"; print " " . PHP_OS . "\n"; print "\n"; print "\n"; print " PHP uname\n"; print " "; if (function_exists('php_uname')) { print php_uname(); }else{ print 'N/A'; } print "\n"; print "\n"; print "\n"; print " PHP SNMP\n"; print " "; if (function_exists('snmpget')) { print 'Installed'; } else { print 'Not Installed'; } print "\n"; print "\n"; print "\n"; print " max_execution_time\n"; print " " . ini_get('max_execution_time') . "\n"; print "\n"; print "\n"; 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 ' . memory_readable($memory_suggestion) . ' or higher.
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"; print "\n"; html_header(array('MySQL Table Information'), 2); print "\n"; print " "; if (sizeof($table_status) > 0) { print "\n"; print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print "\n"; foreach ($table_status as $item) { form_alternate_row(); print ' \n"; print ' \n"; if (isset($item['Engine'])) { print ' \n"; }else{ print " \n"; } if (isset($item['Collation'])) { print ' \n"; } else { print " \n"; } form_end_row(); } if (sizeof($skip_tables)) { print ""; foreach($skip_tables as $table) { print "'; } } print "
NameRowsEngineCollation
' . $item['Name'] . "' . number_format($item['Rows']) . "' . $item['Engine'] . "Unknown' . $item['Collation'] . "Unknown
The Following Tables were Skipped Due to being INNODB
" . $table . '
\n"; }else{ print 'Unable to retrieve table status'; } print "\n"; print "\n"; html_header(array('PHP Module Information'), 2); print "\n"; print " " . $php_info . "\n"; print "\n"; html_end_box(); } function utilities_view_user_log() { global $auth_realms, $item_rows; /* ================= input validation and session storage ================= */ $filters = array( 'rows' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => read_config_option('num_rows_table') ), '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 ================= */ ?>
User Result Attempts
Search '>
'>
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) > 0) { foreach ($user_log as $item) { form_alternate_row('', true); ?> \\1", htmlspecialchars($item['username']))) : htmlspecialchars($item['username']));?> \\1", htmlspecialchars($item['full_name']))) : htmlspecialchars($item['full_name'])); }else{ print '(User Removed)'; } ?> \\1", $auth_realms[$item['realm']])) : $auth_realms[$item['realm']]); }else{ print 'N/A'; } ?> \\1", htmlspecialchars($item['time']))) : htmlspecialchars($item['time']));?> \\1", htmlspecialchars($item['ip']))) : htmlspecialchars($item['ip']));?> 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; $logfile = read_config_option('path_cactilog'); if ($logfile == '') { $logfile = './log/rrd.log'; } /* helps determine output color */ $linecolor = True; /* ================= input validation and session storage ================= */ $filters = array( 'tail_lines' => array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => read_config_option('num_rows_log') ), 'filter' => array( 'filter' => FILTER_CALLBACK, 'pageset' => true, 'default' => '', 'options' => array('options' => 'sanitize_search_string') ), '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 ================= */ $refresh['seconds'] = get_request_var('refresh'); $refresh['page'] = 'utilities.php?action=view_logfile&header=false'; top_header(); ?>
Tail Lines Message Type
Refresh Display Order
Search '>
0) { $start_string = 'Log File [Total Lines: ' . sizeof($logcontents) . ' - Non-Matching Items Hidden]'; }else{ $start_string = 'Log File [Total Lines: ' . sizeof($logcontents) . ' - All Items Shown]'; } 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+5, $host_end-($host_start+5)); $new_item = $new_item . htmlspecialchars(substr($item, 0, $host_start + 5)) . "" . htmlspecialchars(substr($item, $host_start + 5, $host_end-($host_start + 5))) . ''; $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('m/d/Y h:i:s A'); $log_fh = fopen($logfile, 'w'); fwrite($log_fh, $timestamp . " - WEBUI: Cacti Log Cleared from Web Management Interface\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' => read_config_option('num_rows_table') ), '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 ================= */ $refresh['seconds'] = '300'; $refresh['page'] = 'utilities.php?action=view_snmp_cache&header=false'; ?>
Search '> Device Query Name Rows
'>
\\1", htmlspecialchars($item['description']))) : htmlspecialchars($item['description']));?> \\1", htmlspecialchars($item['name']))) : htmlspecialchars($item['name']));?> \\1", htmlspecialchars($item['field_name']))) : htmlspecialchars($item['field_name']));?> \\1", htmlspecialchars($item['field_value']))) : htmlspecialchars($item['field_value']));?> \\1", htmlspecialchars($item['oid']))) : htmlspecialchars($item['oid']));?> array( 'filter' => FILTER_VALIDATE_INT, 'pageset' => true, 'default' => read_config_option('num_rows_table') ), '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 ================= */ $refresh['seconds'] = '300'; $refresh['page'] = 'utilities.php?action=view_poller_cache&header=false'; ?>
Search '> Device Action Entries
'>
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) > 0) { foreach ($poller_cache as $item) { if ($i % 2 == 0) { $class = 'odd'; }else{ $class = 'even'; } print "\n"; ?> \\1", htmlspecialchars($item['name_cache'])):htmlspecialchars($item['name_cache']));?> \\1", htmlspecialchars($item['arg1']))) : htmlspecialchars($item['arg1'])); }else{ $details = 'SNMP Version: ' . $item['snmp_version'] . ', ' . 'User: ' . $item['snmp_username'] . ', OID: ' . $item['arg1']; } }elseif ($item['action'] == 1) { $details = 'Script: ' . (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['arg1']))) : htmlspecialchars($item['arg1'])); }else{ $details = 'Script Server: ' . (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['arg1']))) : htmlspecialchars($item['arg1'])); } print $details; ?> \n"; ?> RRD: '>Technical Support Cacti technical support page. Used by developers and technical support persons to assist with issues in Cacti. Includes checks for common configuration issues. '>View Cacti Log File The Cacti Log File stores statistic, error and other message depending on system settings. This information can be used to identify problems with the poller and application. '>View User Log Allows Administrators to browse the user log. Administrators can filter and export the log as well. '>View Poller Cache This is the data that is being passed to the poller each time it runs. This data is then in turn executed/interpreted and the results are fed into the rrd files for graphing or the database for display. '>View SNMP Cache The SNMP cache stores information gathered from SNMP queries. It is used by cacti to determine the OID to use when gathering information from an SNMP-enabled host. '>Rebuild Poller Cache The poller cache will be cleared and re-generated if you select this option. Sometimes host/data source data can get out of sync with the cache in which case it makes sense to clear the cache and start over. '>View Boost Status This menu pick allows you to view various boost settings and statistics associated with the current running Boost configuration. '>RRDfile Cleaner When you delete Data Sources from Cacti, the corresponding RRDfiles are not removed automatically. Use this utility to facilitate the removal of these old files. '>View SNMPAgent Cache This shows all objects being handled by the SNMPAgent. '>Rebuild SNMPAgent Cache The snmp cache will be cleared and re-generated if you select this option. Note that it takes another poller run to restore the SNMP cache completely. '>View SNMPAgent Notification Log This menu pick allows you to view the latest events SNMPAgent has handled in relation to the registered notification receivers. '>SNMP Notification Receivers Allows Administrators to maintain SNMP notification receivers.
Refresh Interval
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_header(array('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:' . $total_data_sources . ''; if ($total_records > 0) { form_alternate_row(); print 'Pending Boost Records:' . $pending_records . ''; form_alternate_row(); print 'Archived Boost Records:' . $arch_records . ''; form_alternate_row(); print 'Total Boost Records:' . $total_records . ''; } /* boost status display */ html_header(array('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:' . $max_length . ' Bytes'; } /* 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 = ($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_header(array('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) ? (int)($boost_last_run_duration/60) . ' minutes ' : '' ) . $boost_last_run_duration%60 . ' seconds'; if ($rrd_updates != ''){ print ' (' . round(100*$boost_last_run_duration/$update_interval/60) . '% of update frequency)';} 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_header(array('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_header(array('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' => read_config_option('num_rows_table') ), '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 the number of rows is -1, set it to the default */ if (get_request_var('rows') == -1) { $rows = read_config_option('num_rows_table'); }else{ $rows = get_request_var('rows'); } ?>
Search '> MIB OIDs
'>
0) { foreach ($snmp_cache as $item) { $oid = (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['oid']))) : htmlspecialchars($item['oid'])); $name = (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['name']))): htmlspecialchars($item['name'])); $mib = (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['mib']))): htmlspecialchars($item['mib'])); $max_access = (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['max-access']))) : htmlspecialchars($item['max-access'])); form_alternate_row('line' . $item['oid'], false); form_selectable_cell( $oid, $item['oid']); if($item['description']) { print '' . $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(); } } print $nav; html_end_box(); ?> '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' => read_config_option('num_rows_table') ), '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 the number of rows is -1, set it to the default */ if (get_request_var('rows') == -1) { set_request_var('rows', read_config_option('num_rows_table')); } ?>
Search '> Severity Receiver Entries
'>
0) { foreach ($logs as $item) { $varbinds = (strlen(get_request_var('filter')) ? (preg_replace('/(' . preg_quote(get_request_var('filter'), '/') . ')/i', "\\1", htmlspecialchars($item['varbinds']))): htmlspecialchars($item['varbinds'])); form_alternate_row('line' . $item['id'], false); print ""; print "" . date( 'Y/m/d H:i:s', $item['time']) . ''; print '' . $item['hostname'] . ''; if($item['description']) { print '' . htmlspecialchars($item['notification']) . ''; }else { print "" . htmlspecialchars($item['notification']) . ""; } print "$varbinds"; form_end_row(); } print $nav; }else{ print 'No SNMP Notification Log Entries'; } html_end_box(); ?>