if ($_GET['status'] != "") { $search_str .= " Status = " . $_GET['status'] . ", "; } $search_str = rtrim($search_str, ", "); //display what is searched and what is found Form::success("Searched for:" . $search_str . " | Results Found: " . $result_c_count . " child network(s), " . $result_p_count . " parent network(s)"); } else { //just search for everything if nothing is searched $s_results = $IP_Search->search("", "", "", "", "", "", $family); } //if there's no result display nothing if (count($s_results) == 0) { $search_str = ""; } //show the report display_report($ip_manager, $s_results, $search_str); echo "</div>"; } } //this functions retrieves all network from the database and displays them function display_all_networks($arr, $ip_manager) { //if there are no networks in the array show that $string = ""; if (empty($arr)) { $string .= Form::warning("NO Networks!"); //return false; } //loop through the database to see each individual network and their details foreach ($arr as $id => $name) { $ip_2 = new IP_Database($id);
# This is a work around for bug #62 # ini_set("memory_limit", "64M"); # # Keep track of time # $start = gettimeofday(); $start = $start['sec'] + $start['usec'] / 1000000.0; # # Track time elapsed for sql # $global_sql_time_elapsed = 0; # # Display a query screen and report # display_report(); # # Report on script's execution time # $finish = gettimeofday(); $finish = $finish['sec'] + $finish['usec'] / 1000000.0; $elapsed = $finish - $start; # # Display input parameters # debug_cgi($_GET, "GET " . __LINE__); # # Display cookie parameters # debug_cgi($_COOKIE, "COOKIE " . __LINE__); #
function run_alertable_parameter($totalAgentsToProcess, $filterList) { $whereField = create_where_statement_for_all_hosts($totalAgentsToProcess); $query = " SELECT display_name, port, Application_class, parameter, border_active, border_min, border_max, border_trigger, border_occur, border_state, alarm1_active, alarm1_min, alarm1_max, alarm1_trigger, alarm1_occur, alarm1_state, alarm2_active, alarm2_min, alarm2_max, alarm2_trigger, alarm2_occur, alarm2_state, msgTextAlarm, msgTextWarning, msgTextInformation, Polltime, emailalarm, emailwarning, emailinformation FROM agents, thresholds WHERE $whereField AND agents.id = thresholds.agentid AND (arsAlarm != 0 OR arsWarning != 0) AND ((border_active != 0 AND border_state != 0) OR (alarm1_active != 0 AND alarm1_state != 0) OR (alarm2_active != 0 AND alarm2_state != 0)) GROUP BY display_name, application_class, parameter"; $result = run_query($query); if ($filterList != "") { $result = preg_grep ("/$filterList/", $result); } $query = " SELECT display_name FROM agents, thresholds WHERE $whereField AND agents.id = thresholds.agentid AND (arsAlarm != 0 OR arsWarning != 0) AND ((border_active != 0 AND border_state != 0) OR (alarm1_active != 0 AND alarm1_state != 0) OR (alarm2_active != 0 AND alarm2_state != 0)) GROUP BY display_name"; $numberOfHosts = run_query ($query); $hostsWithData = count($numberOfHosts); $totalNumHosts = count ($totalAgentsToProcess); $hostsMissingData = $totalNumHosts - $hostsWithData; if ($hostsMissingData == 0) { $titleString = "Alertable Parameters Report (".howmany ($hostsWithData, "host","hosts").")"; } else { $titleString = "Alertable Parameters Report (".howmany ($hostsWithData, "host","hosts").")"; # $titleString = "Alertable Parameters Report (".howmany ($hostsWithData, "host","hosts")." [missing data for $hostsMissingData of ".howmany($totalNumHosts,"host","hosts")."])"; } ?> <h2><?php print $titleString; ?></h2> <?php return display_report($result); }