function display_general() { global $colors, $config, $rrdtool_versions; require(CACTI_BASE_PATH . "/include/poller/poller_arrays.php"); require(CACTI_BASE_PATH . "/include/data_input/data_input_arrays.php"); /* Get poller stats */ $poller_item = db_fetch_assoc("SELECT action, count(action) as total FROM poller_item GROUP BY action"); /* Get system stats */ $device_count = db_fetch_cell("SELECT COUNT(*) FROM device"); $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(read_config_option("path_rrdtool"), $out_array); if (sizeof($out_array) > 0) { if (preg_match("/^RRDtool 1\.4/", $out_array[0])) { $rrdtool_version = RRD_VERSION_1_4; }else if (preg_match("/^RRDtool 1\.3/", $out_array[0])) { $rrdtool_version = RRD_VERSION_1_3; }else if (preg_match("/^RRDtool 1\.2\./", $out_array[0])) { $rrdtool_version = RRD_VERSION_1_2; }else if (preg_match("/^RRDtool 1\.0\./", $out_array[0])) { $rrdtool_version = RRD_VERSION_1_0; } } } /* Get SNMP cli version */ $snmp_version = read_config_option("snmp_version"); if ((file_exists(read_config_option("path_snmpget"))) && ((function_exists('is_executable')) && (is_executable(read_config_option("path_snmpget"))))) { $snmp_version = trim(shell_exec(read_config_option("path_snmpget") . " -V 2>&1")); } /* Check RRDTool issues */ $rrdtool_error = ""; if ($rrdtool_version != read_config_option("rrdtool_version")) { $rrdtool_error .= "<br><span class='warning'>" . __("ERROR: Installed RRDTool version does not match configured version.") . "<br>" . __("Please visit the") . " <a href='" . htmlspecialchars("settings.php?tab=general") . "'> " . __("Configuration Settings") . "</a>" . __("and select the correct RRDTool Utility Version.") . "</span><br>"; } $graph_gif_count = db_fetch_cell("SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2"); if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") != RRD_VERSION_1_0)) { $rrdtool_error .= "<br><span class='warning'>" . sprintf(__("ERROR: RRDTool 1.2.x does not support the GIF images format, but %s graph(s) and/or templates have GIF set as the image format."), $graph_gif_count) . "</span><br>"; } /* Display tech information */ html_start_box("<strong>" . __("General Technical Support Information") . "</strong>", "100", $colors["header"], 0, "center", ""); print "<tr><td>"; html_header(array(__("General Information")), 2,'','','left wp100'); print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Date") . "</td>\n"; print " <td class='textAreaNotes v'>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Cacti Version") . "</td>\n"; print " <td class='textAreaNotes v'>" . CACTI_VERSION . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Cacti OS") . "</td>\n"; print " <td>" . CACTI_SERVER_OS . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("SNMP Version") . "</td>\n"; print " <td>" . $snmp_version . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("RRDTool Version") . "</td>\n"; print " <td class='textAreaNotes v'>" . $rrdtool_versions[$rrdtool_version] . " " . $rrdtool_error . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Hosts") . "</td>\n"; print " <td class='textAreaNotes v'>" . $device_count . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Graphs") . "</td>\n"; print " <td class='textAreaNotes v'>" . $graph_count . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Data Sources") . "</td>\n"; print " <td class='textAreaNotes v'>"; $data_total = 0; if (sizeof($data_count)) { foreach ($data_count as $item) { print $input_types[$item["type_id"]] . ": " . $item["total"] . "<br>"; $data_total += $item["total"]; } print __("Total:") . " " . $data_total; }else{ print "<span class='warning'>0</span>"; } $spine_version = ""; if ($poller_options[read_config_option("poller_type")] == "spine") { $spine_output = shell_exec(read_config_option("path_spine") . " -v"); $spine_version = substr($spine_output, 6, 6); } print "</table></td></tr>"; /* end of html_header */ print "<tr><td>"; html_header(array(__("Poller Information")), 2,'','','left wp100'); print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Interval") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("poller_interval") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Type"). "</td>\n"; print " <td class='textAreaNotes v'>" . $poller_options[read_config_option("poller_type")] . " " . $spine_version . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Items") . "</td>\n"; print " <td class='textAreaNotes v'>"; $total = 0; if (sizeof($poller_item)) { foreach ($poller_item as $item) { print "Action[" . $item["action"] . "]: " . $item["total"] . "<br>"; $total += $item["total"]; } print __("Total:") . " " . $total; }else{ print "<span class='warning'>" . __("No items to poll") . "</span>"; } print "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Concurrent Processes") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("concurrent_processes") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Max Threads") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("max_threads") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("PHP Servers") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("php_servers") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Script Timeout") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("script_timeout") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("Max OID") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("max_get_size") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("Last Run Statistics") . "</td>\n"; print " <td class='textAreaNotes v'>" . read_config_option("stats_poller") . "</td>\n"; print "</tr>\n"; print "</table></td></tr>"; /* end of html_header */ print "<tr><td>"; html_header(array(__("PHP Information")), 2,'','','left wp100'); print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("PHP Version") . "</td>\n"; print " <td class='textAreaNotes v'>" . phpversion() . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("PHP OS") . "</td>\n"; print " <td class='textAreaNotes v'>" . PHP_OS . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>" . __("PHP uname") . "</td>\n"; print " <td class='textAreaNotes v'>"; if (function_exists("php_uname")) { print php_uname(); }else{ print __("N/A"); } print "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>" . __("PHP SNMP") . "</td>\n"; print " <td class='textAreaNotes v'>"; if (function_exists("snmpget")) { print __("Installed"); } else { print __("Not Installed"); } print "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate1'>\n"; print " <td class='textAreaNotes e'>max_execution_time</td>\n"; print " <td class='textAreaNotes v'>" . ini_get("max_execution_time") . "</td>\n"; print "</tr>\n"; print "<tr class='rowAlternate2'>\n"; print " <td class='textAreaNotes e'>memory_limit</td>\n"; print " <td class='textAreaNotes v'>" . 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 "<br><span class='warning'>" . sprintf(__("It is highly suggested that you either alter you php.ini memory_limit to %s or higher, or set a value for \$config['memory_limit'] in include/config.php. 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."), memory_readable($memory_suggestion)) . "</font><br>"; } print "</table></td></tr>"; /* end of html_header */ html_end_box(); }
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\\.4/", $out_array[0])) { $rrdtool_version = "rrd-1.4.x"; } else { if (preg_match("/^RRDtool 1\\.3\\./", $out_array[0])) { $rrdtool_version = "rrd-1.3.x"; } else { if (preg_match("/^RRDtool 1\\.2\\./", $out_array[0])) { $rrdtool_version = "rrd-1.2.x"; } else { if (preg_match("/^RRDtool 1\\.0\\./", $out_array[0])) { $rrdtool_version = "rrd-1.0.x"; } } } } } } /* Get SNMP cli version */ $snmp_version = read_config_option("snmp_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"); } /* Check RRDTool issues */ $rrdtool_error = ""; if ($rrdtool_version != read_config_option("rrdtool_version")) { $rrdtool_error .= "<br><font color='red'>ERROR: Installed RRDTool version does not match configured version.<br>Please visit the <a href='" . htmlspecialchars("settings.php?tab=general") . "'>Configuration Settings</a> and select the correct RRDTool Utility Version.</font><br>"; } $graph_gif_count = db_fetch_cell("SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2"); if ($graph_gif_count > 0 && read_config_option("rrdtool_version") != "rrd-1.0.x") { $rrdtool_error .= "<br><font color='red'>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.</font><br>"; } /* 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("<strong>Technical Support</strong>", "100%", "", "3", "center", ""); html_header(array("General Information"), 2); print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Date</td>\n"; print "\t\t<td class='textArea'>" . date("r") . "</td>\n"; print "</tr>\n"; api_plugin_hook_function('custom_version_info'); print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Cacti Version</td>\n"; print "\t\t<td class='textArea'>" . $config["cacti_version"] . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Cacti OS</td>\n"; print "\t\t<td class='textArea'>" . $config["cacti_server_os"] . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>SNMP Version</td>\n"; print "\t\t<td class='textArea'>" . $snmp_version . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>RRDTool Version</td>\n"; print "\t\t<td class='textArea'>" . $rrdtool_versions[$rrdtool_version] . " " . $rrdtool_error . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Hosts</td>\n"; print "\t\t<td class='textArea'>" . $host_count . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Graphs</td>\n"; print "\t\t<td class='textArea'>" . $graph_count . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Data Sources</td>\n"; print "\t\t<td class='textArea'>"; $data_total = 0; if (sizeof($data_count)) { foreach ($data_count as $item) { print $input_types[$item["type_id"]] . ": " . $item["total"] . "<br>"; $data_total += $item["total"]; } print "Total: " . $data_total; } else { print "<font color='red'>0</font>"; } print "</td>\n"; print "</tr>\n"; html_header(array("Poller Information"), 2); print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Interval</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("poller_interval") . "</td>\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 "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Type</td>\n"; print "\t\t<td class='textArea'>" . $type . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Items</td>\n"; print "\t\t<td class='textArea'>"; $total = 0; if (sizeof($poller_item)) { foreach ($poller_item as $item) { print "Action[" . $item["action"] . "]: " . $item["total"] . "<br>"; $total += $item["total"]; } print "Total: " . $total; } else { print "<font color='red'>No items to poll</font>"; } print "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Concurrent Processes</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("concurrent_processes") . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Max Threads</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("max_threads") . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>PHP Servers</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("php_servers") . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Script Timeout</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("script_timeout") . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>Max OID</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("max_get_size") . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>Last Run Statistics</td>\n"; print "\t\t<td class='textArea'>" . read_config_option("stats_poller") . "</td>\n"; print "</tr>\n"; html_header(array("PHP Information"), 2); print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>PHP Version</td>\n"; print "\t\t<td class='textArea'>" . phpversion() . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>PHP OS</td>\n"; print "\t\t<td class='textArea'>" . PHP_OS . "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>PHP uname</td>\n"; print "\t\t<td class='textArea'>"; if (function_exists("php_uname")) { print php_uname(); } else { print "N/A"; } print "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>PHP SNMP</td>\n"; print "\t\t<td class='textArea'>"; if (function_exists("snmpget")) { print "Installed"; } else { print "Not Installed"; } print "</td>\n"; print "</tr>\n"; print "<tr class='odd'>\n"; print "\t\t<td class='textArea'>max_execution_time</td>\n"; print "\t\t<td class='textArea'>" . ini_get("max_execution_time") . "</td>\n"; print "</tr>\n"; print "<tr class='even'>\n"; print "\t\t<td class='textArea'>memory_limit</td>\n"; print "\t\t<td class='textArea'>" . 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 "<br><font color='red'>"; if (ini_get('memory_limit') == -1) { print "You've set memory limit to 'unlimited'.<br/>"; } print "It is highly suggested that you alter you php.ini memory_limit to " . memory_readable($memory_suggestion) . " or higher. <br/>\n\t\t\tThis 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 "</font><br>"; } print "</td>\n"; print "</tr>\n"; html_header(array("MySQL Table Information"), 2); print "<tr class='odd'>\n"; print "\t\t<td class='textArea' colspan='2' align='center'>"; if (sizeof($table_status) > 0) { print "<table border='1' cellpadding='2' cellspacing='0'>\n"; print "<tr>\n"; print " <th>Name</th>\n"; print " <th>Rows</th>\n"; print " <th>Engine</th>\n"; print " <th>Collation</th>\n"; print "</tr>\n"; foreach ($table_status as $item) { print "<tr>\n"; print " <td>" . $item["Name"] . "</td>\n"; print " <td>" . $item["Rows"] . "</td>\n"; if (isset($item["Engine"])) { print " <td>" . $item["Engine"] . "</td>\n"; } else { print " <td>Unknown</td>\n"; } if (isset($item["Collation"])) { print " <td>" . $item["Collation"] . "</td>\n"; } else { print " <td>Unknown</td>\n"; } print "</tr>\n"; } if (sizeof($skip_tables)) { print "<tr><td colspan='20' align='center'><strong>The Following Tables were Skipped Due to being INNODB</strong></td></tr>"; foreach ($skip_tables as $table) { print "<tr><td colspan='20' align='center'>" . $table . "</td></tr>"; } } print "</table>\n"; } else { print "Unable to retrieve table status"; } print "</td>\n"; print "</tr>\n"; html_header(array("PHP Module Information"), 2); print "<tr class='odd'>\n"; print "\t\t<td class='textArea' colspan='2'>" . $php_info . "</td>\n"; print "</tr>\n"; html_end_box(); }
function utilities_view_tech($php_info = "") { global $colors, $config, $rrdtool_versions, $poller_options, $input_types; /* Get table status */ $table_status = db_fetch_assoc("SHOW TABLE 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"))) && (($config["cacti_server_os"] == "win32") || (is_executable(read_config_option("path_rrdtool"))))) { $out_array = array(); exec(read_config_option("path_rrdtool"), $out_array); if (sizeof($out_array) > 0) { if (ereg("^RRDtool 1\.2", $out_array[0])) { $rrdtool_version = "rrd-1.2.x"; }else if (ereg("^RRDtool 1\.0\.", $out_array[0])) { $rrdtool_version = "rrd-1.0.x"; } } } /* Check RRDTool issues */ $rrdtool_error = ""; if ($rrdtool_version != read_config_option("rrdtool_version")) { $rrdtool_error .= "<br><font color='red'>ERROR: Installed RRDTool version does not match configured version.<br>Please visit the <a href='settings.php?tab=general'>Configuration Settings</a> and select the correct RRDTool Utility Version.</font><br>"; } $graph_gif_count = db_fetch_cell("SELECT COUNT(*) FROM graph_templates_graph WHERE image_format_id = 2"); if (($graph_gif_count > 0) && (read_config_option("rrdtool_version") == "rrd-1.2.x")) { $rrdtool_error .= "<br><font color='red'>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.</font><br>"; } /* Display tech information */ html_start_box("<strong>Technical Support</strong>", "100%", $colors["header"], "3", "center", ""); html_header(array("General Information"), 2); print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Date</td>\n"; print " <td class='textArea'>" . date("r") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Cacti Version</td>\n"; print " <td class='textArea'>" . $config["cacti_version"] . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Cacti OS</td>\n"; print " <td class='textArea'>" . $config["cacti_server_os"] . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>SNMP Version</td>\n"; print " <td class='textArea'>" . read_config_option("snmp_version") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>RRDTool Version</td>\n"; print " <td class='textArea'>" . $rrdtool_versions[$rrdtool_version] . " " . $rrdtool_error . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Hosts</td>\n"; print " <td class='textArea'>" . $host_count . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Graphs</td>\n"; print " <td class='textArea'>" . $graph_count . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Data Sources</td>\n"; print " <td class='textArea'>"; $data_total = 0; if (sizeof($data_count)) { foreach ($data_count as $item) { print $input_types[$item["type_id"]] . ": " . $item["total"] . "<br>"; $data_total += $item["total"]; } print "Total: " . $data_total; }else{ print "<font color='red'>0</font>"; } print "</td>\n"; print "</tr>\n"; html_header(array("Poller Information"), 2); print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Interval</td>\n"; print " <td class='textArea'>" . read_config_option("poller_interval") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Type</td>\n"; print " <td class='textArea'>" . $poller_options[read_config_option("poller_type")] . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Items</td>\n"; print " <td class='textArea'>"; $total = 0; if (sizeof($poller_item)) { foreach ($poller_item as $item) { print "Action[" . $item["action"] . "]: " . $item["total"] . "<br>"; $total += $item["total"]; } print "Total: " . $total; }else{ print "<font color='red'>No items to poll</font>"; } print "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Concurrent Processes</td>\n"; print " <td class='textArea'>" . read_config_option("concurrent_processes") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Max Threads</td>\n"; print " <td class='textArea'>" . read_config_option("max_threads") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>PHP Servers</td>\n"; print " <td class='textArea'>" . read_config_option("php_servers") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Script Timeout</td>\n"; print " <td class='textArea'>" . read_config_option("script_timeout") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>Max OID</td>\n"; print " <td class='textArea'>" . read_config_option("max_get_size") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>Last Run Statistics</td>\n"; print " <td class='textArea'>" . read_config_option("stats_poller") . "</td>\n"; print "</tr>\n"; html_header(array("PHP Information"), 2); print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>PHP Version</td>\n"; print " <td class='textArea'>" . phpversion() . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>PHP OS</td>\n"; print " <td class='textArea'>" . PHP_OS . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>PHP uname</td>\n"; print " <td class='textArea'>"; if (function_exists("php_uname")) { print php_uname(); }else{ print "N/A"; } print "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>PHP SNMP</td>\n"; print " <td class='textArea'>"; if (function_exists("snmpget")) { print "Installed"; } else { print "Not Installed"; } print "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea'>max_execution_time</td>\n"; print " <td class='textArea'>" . ini_get("max_execution_time") . "</td>\n"; print "</tr>\n"; print "<tr bgcolor='" . $colors["form_alternate2"] . "'>\n"; print " <td class='textArea'>memory_limit</td>\n"; print " <td class='textArea'>" . 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 "<br><font color='red'>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.</font><br>"; } print "</td>\n"; print "</tr>\n"; html_header(array("MySQL Table Information"), 2); print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea' colspan='2' align='center'>"; if (sizeof($table_status) > 0) { print "<table border='1' cellpadding='2' cellspacing='0'>\n"; print "<tr>\n"; print " <th>Name</th>\n"; print " <th>Rows</th>\n"; print " <th>Engine</th>\n"; print " <th>Collation</th>\n"; print " <th>Check Status</th>\n"; print "</tr>\n"; foreach ($table_status as $item) { print "<tr>\n"; print " <td>" . $item["Name"] . "</td>\n"; print " <td>" . $item["Rows"] . "</td>\n"; if (isset($item["Engine"])) { print " <td>" . $item["Engine"] . "</td>\n"; }else{ print " <td>Unknown</td>\n"; } if (isset($item["Collation"])) { print " <td>" . $item["Collation"] . "</td>\n"; } else { print " <td>Unknown</td>\n"; } print " <td>" . db_fetch_cell("CHECK TABLE " . $item["Name"], "Msg_text") . "</td>\n"; print "</tr>\n"; } print "</table>\n"; }else{ print "Unable to retrieve table status"; } print "</td>\n"; print "</tr>\n"; html_header(array("PHP Module Information"), 2); print "<tr bgcolor='" . $colors["form_alternate1"] . "'>\n"; print " <td class='textArea' colspan='2'>" . $php_info . "</td>\n"; print "</tr>\n"; html_end_box(); }