203
203
function utilities_view_tech($php_info = "") {
204
global $database_default, $colors, $config, $rrdtool_versions, $poller_options, $input_types;
204
global $database_default, $config, $rrdtool_versions, $poller_options, $input_types;
206
206
/* Get table status */
207
207
$tables = db_fetch_assoc("SHOW TABLES");
287
287
/* Display tech information */
288
html_start_box("<strong>Technical Support</strong>", "100%", $colors["header"], "3", "center", "");
288
html_start_box("<strong>Technical Support</strong>", "100%", "", "3", "center", "");
289
289
html_header(array("General Information"), 2);
290
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
290
print "<tr class='odd'>\n";
291
291
print " <td class='textArea'>Date</td>\n";
292
292
print " <td class='textArea'>" . date("r") . "</td>\n";
294
294
api_plugin_hook_function('custom_version_info');
295
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
295
print "<tr class='even'>\n";
296
296
print " <td class='textArea'>Cacti Version</td>\n";
297
297
print " <td class='textArea'>" . $config["cacti_version"] . "</td>\n";
299
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
299
print "<tr class='odd'>\n";
300
300
print " <td class='textArea'>Cacti OS</td>\n";
301
301
print " <td class='textArea'>" . $config["cacti_server_os"] . "</td>\n";
303
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
303
print "<tr class='even'>\n";
304
304
print " <td class='textArea'>SNMP Version</td>\n";
305
305
print " <td class='textArea'>" . $snmp_version . "</td>\n";
308
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
308
print "<tr class='odd'>\n";
309
309
print " <td class='textArea'>RRDTool Version</td>\n";
310
310
print " <td class='textArea'>" . $rrdtool_versions[$rrdtool_version] . " " . $rrdtool_error . "</td>\n";
312
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
312
print "<tr class='even'>\n";
313
313
print " <td class='textArea'>Hosts</td>\n";
314
314
print " <td class='textArea'>" . $host_count . "</td>\n";
316
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
316
print "<tr class='odd'>\n";
317
317
print " <td class='textArea'>Graphs</td>\n";
318
318
print " <td class='textArea'>" . $graph_count . "</td>\n";
320
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
320
print "<tr class='even'>\n";
321
321
print " <td class='textArea'>Data Sources</td>\n";
322
322
print " <td class='textArea'>";
336
336
html_header(array("Poller Information"), 2);
337
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
337
print "<tr class='odd'>\n";
338
338
print " <td class='textArea'>Interval</td>\n";
339
339
print " <td class='textArea'>" . read_config_option("poller_interval") . "</td>\n";
340
340
if (file_exists(read_config_option("path_spine")) && $poller_options[read_config_option("poller_type")] == 'spine') {
343
343
$type = $poller_options[read_config_option("poller_type")];
346
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
346
print "<tr class='even'>\n";
347
347
print " <td class='textArea'>Type</td>\n";
348
348
print " <td class='textArea'>" . $type . "</td>\n";
350
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
350
print "<tr class='odd'>\n";
351
351
print " <td class='textArea'>Items</td>\n";
352
352
print " <td class='textArea'>";
366
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
366
print "<tr class='even'>\n";
367
367
print " <td class='textArea'>Concurrent Processes</td>\n";
368
368
print " <td class='textArea'>" . read_config_option("concurrent_processes") . "</td>\n";
371
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
371
print "<tr class='odd'>\n";
372
372
print " <td class='textArea'>Max Threads</td>\n";
373
373
print " <td class='textArea'>" . read_config_option("max_threads") . "</td>\n";
376
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
376
print "<tr class='even'>\n";
377
377
print " <td class='textArea'>PHP Servers</td>\n";
378
378
print " <td class='textArea'>" . read_config_option("php_servers") . "</td>\n";
381
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
381
print "<tr class='odd'>\n";
382
382
print " <td class='textArea'>Script Timeout</td>\n";
383
383
print " <td class='textArea'>" . read_config_option("script_timeout") . "</td>\n";
386
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
386
print "<tr class='even'>\n";
387
387
print " <td class='textArea'>Max OID</td>\n";
388
388
print " <td class='textArea'>" . read_config_option("max_get_size") . "</td>\n";
392
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
392
print "<tr class='odd'>\n";
393
393
print " <td class='textArea'>Last Run Statistics</td>\n";
394
394
print " <td class='textArea'>" . read_config_option("stats_poller") . "</td>\n";
398
398
html_header(array("PHP Information"), 2);
399
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
399
print "<tr class='odd'>\n";
400
400
print " <td class='textArea'>PHP Version</td>\n";
401
401
print " <td class='textArea'>" . phpversion() . "</td>\n";
403
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
403
print "<tr class='even'>\n";
404
404
print " <td class='textArea'>PHP OS</td>\n";
405
405
print " <td class='textArea'>" . PHP_OS . "</td>\n";
407
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
407
print "<tr class='odd'>\n";
408
408
print " <td class='textArea'>PHP uname</td>\n";
409
409
print " <td class='textArea'>";
410
410
if (function_exists("php_uname")) {
427
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
427
print "<tr class='odd'>\n";
428
428
print " <td class='textArea'>max_execution_time</td>\n";
429
429
print " <td class='textArea'>" . ini_get("max_execution_time") . "</td>\n";
431
print "<tr bgcolor='#" . $colors["form_alternate2"] . "'>\n";
431
print "<tr class='even'>\n";
432
432
print " <td class='textArea'>memory_limit</td>\n";
433
433
print " <td class='textArea'>" . ini_get("memory_limit");
459
459
html_header(array("MySQL Table Information"), 2);
460
print "<tr bgcolor='#" . $colors["form_alternate1"] . "'>\n";
460
print "<tr class='odd'>\n";
461
461
print " <td class='textArea' colspan='2' align='center'>";
462
462
if (sizeof($table_status) > 0) {
463
463
print "<table border='1' cellpadding='2' cellspacing='0'>\n";
586
html_start_box("<strong>User Login History</strong>", "100%", $colors["header"], "3", "center", "");
586
html_start_box("<strong>User Login History</strong>", "100%", "", "3", "center", "");
589
<tr bgcolor="#<?php print $colors["panel"];?>">
589
<tr class='even noprint'>
591
591
<form name="form_userlog" action="utilities.php">
592
592
<table cellpadding="0" cellspacing="0">
675
html_start_box("", "100%", $colors["header"], "3", "center", "");
675
html_start_box("", "100%", "", "3", "center", "");
677
677
$total_rows = db_fetch_cell("SELECT
695
695
ORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . "
696
696
LIMIT " . (read_config_option("num_rows_data_source")*(get_request_var_request("page")-1)) . "," . read_config_option("num_rows_data_source");
698
// print $user_log_sql;
700
698
$user_log = db_fetch_assoc($user_log_sql);
702
/* generate page list */
703
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_data_source"), $total_rows, "utilities.php?action=view_user_log&username=" . get_request_var_request("username") . "&filter=" . get_request_var_request("filter"));
705
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
707
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
709
<td align='left' class='textHeaderDark'>
710
<strong><< "; if (get_request_var_request("page") > 1) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_user_log&username=" . get_request_var_request("username") . "&filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")-1)) . "'>"; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= "</a>"; } $nav .= "</strong>
712
<td align='center' class='textHeaderDark'>
713
Showing Rows " . ((read_config_option("num_rows_data_source")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_data_source")) || ($total_rows < (read_config_option("num_rows_data_source")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_data_source")*get_request_var_request("page"))) . " of $total_rows [$url_page_select]
715
<td align='right' class='textHeaderDark'>
716
<strong>"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_user_log&username=" . get_request_var_request("username") . "&filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")+1)) . "'>"; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
700
$nav = html_nav_bar("utilities.php?action=view_user_log&username=" . get_request_var_request("username") . "&filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), read_config_option("num_rows_data_source"), $total_rows, 6);
733
712
html_header_sort($display_text, get_request_var_request("sort_column"), get_request_var_request("sort_direction"));
736
714
if (sizeof($user_log) > 0) {
737
715
foreach ($user_log as $item) {
738
if (isset($item["full_name"])) {
739
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
741
form_alternate_row_color("FF9D9D","FFAFAF",$i);
716
form_alternate_row('', true);
744
718
<td style='white-space:nowrap;'>
745
719
<?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["username"])) : $item["username"]);?>
864
html_start_box("<strong>Log File Filters</strong>", "100%", $colors["header"], "3", "center", "");
839
html_start_box("<strong>Log File Filters</strong>", "100%", "", "3", "center", "");
867
<tr bgcolor="#<?php print $colors["panel"];?>">
842
<tr class='even noprint'>
869
844
<form name="form_logfile" action="utilities.php">
870
845
<table cellpadding="1" cellspacing="0">
956
931
$start_string = "<strong>Log File</strong> [Total Lines: " . sizeof($logcontents) . " - All Items Shown]";
959
html_start_box($start_string, "100%", $colors["header"], "3", "center", "");
934
html_start_box($start_string, "100%", "", "3", "center", "");
1054
1027
$logfile = "./log/cacti.log";
1057
html_start_box("<strong>Clear Cacti Log File</strong>", "100%", $colors["header"], "1", "center", "");
1030
html_start_box("<strong>Clear Cacti Log File</strong>", "100%", "", "1", "center", "");
1058
1031
if (file_exists($logfile)) {
1059
1032
if (is_writable($logfile)) {
1060
1033
$timestamp = date("m/d/Y h:i:s A");
1129
html_start_box("<strong>SNMP Cache Items</strong>", "100%", $colors["header"], "3", "center", "");
1102
html_start_box("<strong>SNMP Cache Items</strong>", "100%", "", "3", "center", "");
1132
<tr bgcolor="#<?php print $colors["panel"];?>">
1105
<tr class='even noprint'>
1134
1107
<form name="form_snmpcache" action="utilities.php">
1135
1108
<table cellpadding="0" cellspacing="0">
1251
1224
OR host_snmp_cache.oid LIKE '%%" . get_request_var_request("filter") . "%%')";
1254
html_start_box("", "100%", $colors["header"], "3", "center", "");
1227
html_start_box("", "100%", "", "3", "center", "");
1256
1229
$total_rows = db_fetch_cell("SELECT
1271
1244
LIMIT " . (read_config_option("num_rows_data_source")*(get_request_var_request("page")-1)) . "," . read_config_option("num_rows_data_source");
1273
// print $snmp_cache_sql;
1275
1246
$snmp_cache = db_fetch_assoc($snmp_cache_sql);
1277
/* generate page list */
1278
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_data_source"), $total_rows, "utilities.php?action=view_snmp_cache&host_id=" . get_request_var_request("host_id") . "&filter=" . get_request_var_request("filter"));
1280
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
1282
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
1284
<td align='left' class='textHeaderDark'>
1285
<strong><< "; if (get_request_var_request("page") > 1) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_snmp_cache&host_id=" . get_request_var_request("host_id") . "&filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")-1)) . "'>"; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= "</a>"; } $nav .= "</strong>
1287
<td align='center' class='textHeaderDark'>
1288
Showing Rows " . ((read_config_option("num_rows_data_source")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_data_source")) || ($total_rows < (read_config_option("num_rows_data_source")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_data_source")*get_request_var_request("page"))) . " of $total_rows [$url_page_select]
1290
<td align='right' class='textHeaderDark'>
1291
<strong>"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_snmp_cache&host_id=" . get_request_var_request("host_id") . "&filter=" . get_request_var_request("filter") . "&page=" . (get_request_var_request("page")+1)) . "'>"; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
1248
$nav = html_nav_bar("utilities.php?action=view_snmp_cache&host_id=" . get_request_var_request("host_id") . "&filter=" . get_request_var_request("filter"), MAX_DISPLAY_PAGES, get_request_var_request("page"), read_config_option("num_rows_data_source"), $total_rows, 3);
1303
1255
if (sizeof($snmp_cache) > 0) {
1304
foreach ($snmp_cache as $item) {
1305
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
1308
Host: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["description"])) : $item["description"]);?>
1309
, SNMP Query: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["name"])) : $item["name"]);?>
1313
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
1316
Index: <?php print $item["snmp_index"];?>
1317
, Field Name: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["field_name"])) : $item["field_name"]);?>
1318
, Field Value: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["field_value"])) : $item["field_value"]);?>
1322
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i); $i++;
1325
OID: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["oid"])) : $item["oid"]);?>
1256
foreach ($snmp_cache as $item) {
1257
form_alternate_row();
1260
Host: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["description"])) : $item["description"]);?>
1261
, SNMP Query: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["name"])) : $item["name"]);?>
1265
form_alternate_row();
1268
Index: <?php print $item["snmp_index"];?>
1269
, Field Name: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["field_name"])) : $item["field_name"]);?>
1270
, Field Value: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["field_value"])) : $item["field_value"]);?>
1274
form_alternate_row();
1277
OID: <?php print (strlen(get_request_var_request("filter")) ? (preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["oid"])) : $item["oid"]);?>
1334
1286
html_end_box();
1337
1289
function utilities_view_poller_cache() {
1338
global $colors, $poller_actions;
1290
global $poller_actions;
1340
1292
define("MAX_DISPLAY_PAGES", 21);
1409
html_start_box("<strong>Poller Cache Items</strong>", "100%", $colors["header"], "3", "center", "");
1361
html_start_box("<strong>Poller Cache Items</strong>", "100%", "", "3", "center", "");
1412
<tr bgcolor="#<?php print $colors["panel"];?>">
1364
<tr class='even noprint'>
1414
1366
<form name="form_pollercache" action="utilities.php">
1415
1367
<table cellpadding="0" cellspacing="0">
1487
1439
OR poller_item.rrd_path LIKE '%%" . get_request_var_request("filter") . "%%')";
1490
html_start_box("", "100%", $colors["header"], "3", "center", "");
1442
html_start_box("", "100%", "", "3", "center", "");
1492
1444
$total_rows = db_fetch_cell("SELECT
1511
1463
ORDER BY " . get_request_var_request("sort_column") . " " . get_request_var_request("sort_direction") . ", action ASC
1512
1464
LIMIT " . (read_config_option("num_rows_data_source")*(get_request_var_request("page")-1)) . "," . read_config_option("num_rows_data_source");
1514
// print $poller_sql;
1516
1466
$poller_cache = db_fetch_assoc($poller_sql);
1518
/* generate page list */
1519
$url_page_select = get_page_list(get_request_var_request("page"), MAX_DISPLAY_PAGES, read_config_option("num_rows_data_source"), $total_rows, "utilities.php?action=view_poller_cache&host_id=" . get_request_var_request("host_id") . "&poller_action=" . get_request_var_request("poller_action"));
1521
$nav = "<tr bgcolor='#" . $colors["header"] . "'>
1523
<table width='100%' cellspacing='0' cellpadding='0' border='0'>
1525
<td align='left' class='textHeaderDark'>
1526
<strong><< "; if (get_request_var_request("page") > 1) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_poller_cache&host_id=" . get_request_var_request("host_id") . "&poller_action=" . get_request_var_request("poller_action") . "&page=" . (get_request_var_request("page")-1)) . "'>"; } $nav .= "Previous"; if (get_request_var_request("page") > 1) { $nav .= "</a>"; } $nav .= "</strong>
1528
<td align='center' class='textHeaderDark'>
1529
Showing Rows " . ((read_config_option("num_rows_data_source")*(get_request_var_request("page")-1))+1) . " to " . ((($total_rows < read_config_option("num_rows_data_source")) || ($total_rows < (read_config_option("num_rows_data_source")*get_request_var_request("page")))) ? $total_rows : (read_config_option("num_rows_data_source")*get_request_var_request("page"))) . " of $total_rows [$url_page_select]
1531
<td align='right' class='textHeaderDark'>
1532
<strong>"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "<a class='linkOverDark' href='" . htmlspecialchars("utilities.php?action=view_poller_cache&host_id=" . get_request_var_request("host_id") . "&poller_action=" . get_request_var_request("poller_action") . "&page=" . (get_request_var_request("page")+1)) . "'>"; } $nav .= "Next"; if ((get_request_var_request("page") * read_config_option("num_rows_data_source")) < $total_rows) { $nav .= "</a>"; } $nav .= " >></strong>
1468
$nav = html_nav_bar("utilities.php?action=view_poller_cache&host_id=" . get_request_var_request("host_id") . "&poller_action=" . get_request_var_request("poller_action"), MAX_DISPLAY_PAGES, get_request_var_request("page"), read_config_option("num_rows_data_source"), $total_rows, 3);
1548
1479
if (sizeof($poller_cache) > 0) {
1549
1480
foreach ($poller_cache as $item) {
1550
form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i);
1481
form_alternate_row();
1552
1483
<td width="375">
1553
1484
<a class="linkEditMain" href="<?php print htmlspecialchars("data_sources.php?action=ds_edit&id=" . $item["local_data_id"]);?>"><?php print (strlen(get_request_var_request("filter")) ? preg_replace("/(" . preg_quote(get_request_var_request("filter"), "/") . ")/i", "<span style='background-color: #F8D93D;'>\\1</span>", $item["name_cache"]):$item["name_cache"]);?></a>
1599
1530
function utilities() {
1602
html_start_box("<strong>Cacti System Utilities</strong>", "100%", $colors["header"], "3", "center", "");
1531
html_start_box("<strong>Cacti System Utilities</strong>", "100%", "", "3", "center", "");
1605
1534
<colgroup span="3">