<commit_before><?
/**
Oreon is developped with GPL Licence 2.0 :
http://www.gnu.org/licenses/gpl.txt
Developped by : <NAME> - <NAME>

The Software is provided to you AS IS and WITH ALL FAULTS.
OREON makes no representation and gives no warranty whatsoever,
whether express or implied, and without limitation, with regard to the quality,
safety, contents, performance, merchantability, non-infringement or suitability for
any particular or intended purpose of the Software found on the OREON web site.
In no event will OREON be liable for any direct, indirect, punitive, special,
incidental or consequential damages however they may arise and even if OREON has
been previously advised of the possibility of such damages.

For information : <EMAIL>
*/
	if (!isset($oreon))
		exit();
		
	$pagination = "maxViewMonitoring";		

	#create javascript for refresh ajax
	include('./include/monitoring/status/makeJS.php');

	# set limit & num
	$DBRESULT =& $pearDB->query("SELECT maxViewMonitoring FROM general_opt LIMIT 1");
	if (PEAR::isError($DBRESULT))
		print "Mysql Error : ".$DBRESULT->getMessage();
	$gopt = array_map("myDecode", $DBRESULT->fetchRow());		

	!isset($_GET["limit"]) ? $limit = $gopt["maxViewMonitoring"] : $limit = $_GET["limit"];
	!isset($_GET["num"]) ? $num = 0 : $num = $_GET["num"];

	if ($o != "svc_ok"){
		!isset($_GET["sort_types"]) ? $sort_types = $oreon->OptGen["problem_sort_type"] : $sort_types = $_GET["sort_types"];
		!isset($_GET["order"]) ? $order = "SORT_".$oreon->OptGen["problem_sort_order"] : $order = $_GET["order"];
	} else {
		$sort_types = "host_name";
		$order = "DESC";
	}
	
	# start quickSearch form
	include_once("./include/common/quickSearch.php");
	# end quickSearch form

	$tab_class = array("0" => "list_one", "1" => "list_two");
	$rows = 0;
	$service_status_num = array();
	if ($o == "svcpb"){
		if (isset($service_status))
			foreach ($service_status as $name => $svc){			
				$tmp = array();
				$tmp[0] = $name;
				if (strcmp($svc["current_state"], "OK")){
					$service_status[$name]["host_status"] = $host_status[$service_status[$name]["host_name"]]["current_state"];
					$service_status[$name]["host_color"] = $oreon->optGen["color_".strtolower($service_status[$name]["host_status"])];
					$service_status[$name]["status_color"] = $oreon->optGen["color_".strtolower($svc["current_state"])];
					if ($svc["last_check"]){
						$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
						$service_status[$name]["last_state_change"] = Duration::toString(time() - $svc["last_state_change"]);
					} else {
						$service_status[$name]["last_check"] = "";
						$service_status[$name]["last_state_change"] = "";
					}
					$service_status[$name]["class"] = $tab_class[$rows % 2];
					$tmp[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp;
				}
			}
			$service_status_num = array();
			$rows = 0;
			$tmp = array();
			foreach ($service_status as $name => $svc)
				if($service_status[$name]["current_state"] != 'OK'){
					$tmp2 = array();
					$tmp2[0] = $name;		
					$tmp[$name] = $service_status[$name];
					$tmp2[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp2;
				}
	} else {
		$tab = array("svc_warning" => "WARNING", "svc_unknown" => "UNKNOWN", "svc_critical" => "CRITICAL", "svc_ok" => "OK");
		if (isset($service_status))
			foreach ($service_status as $name => $svc){			
				$tmp = array();
				$tmp[0] = $name;
				if (!strcmp($svc["current_state"], $tab[$o])){
					$service_status[$name]["host_status"] = $host_status[$service_status[$name]["host_name"]]["current_state"];
					$service_status[$name]["host_color"] = $oreon->optGen["color_".strtolower($service_status[$name]["host_status"])];
					$service_status[$name]["status_color"] = $oreon->optGen["color_".strtolower($svc["current_state"])];
					if ($svc["last_check"]){
						$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
						$service_status[$name]["last_state_change"] = Duration::toString(time() - $svc["last_state_change"]);
					} else {
						$service_status[$name]["last_check"] = "";
						$service_status[$name]["last_state_change"] = "";
					}
					$service_status[$name]["class"] = $tab_class[$rows % 2];
					$tmp[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp;
				}
			}
		$service_status_num = array();
		$rows = 0;
		$tmp = array();
		foreach ($service_status as $name => $svc)
			if($service_status[$name]["current_state"] == $tab[$o]){
				$tmp2 = array();
				$tmp2[0] = $name;		
				$tmp[$name] = $service_status[$name];
				$tmp2[1] = $service_status[$name];
				$service_status_num[$rows++] = $tmp2;<commit_msg>bug service summary when click on ok service<commit_after><?
/**
Oreon is developped with GPL Licence 2.0 :
http://www.gnu.org/licenses/gpl.txt
Developped by : <NAME> - <NAME>

The Software is provided to you AS IS and WITH ALL FAULTS.
OREON makes no representation and gives no warranty whatsoever,
whether express or implied, and without limitation, with regard to the quality,
safety, contents, performance, merchantability, non-infringement or suitability for
any particular or intended purpose of the Software found on the OREON web site.
In no event will OREON be liable for any direct, indirect, punitive, special,
incidental or consequential damages however they may arise and even if OREON has
been previously advised of the possibility of such damages.

For information : <EMAIL>
*/
	if (!isset($oreon))
		exit();
		
	$pagination = "maxViewMonitoring";		

	#create javascript for refresh ajax
	include('./include/monitoring/status/makeJS.php');

	# set limit & num
	$DBRESULT =& $pearDB->query("SELECT maxViewMonitoring FROM general_opt LIMIT 1");
	if (PEAR::isError($DBRESULT))
		print "Mysql Error : ".$DBRESULT->getMessage();
	$gopt = array_map("myDecode", $DBRESULT->fetchRow());		

	!isset($_GET["limit"]) ? $limit = $gopt["maxViewMonitoring"] : $limit = $_GET["limit"];
	!isset($_GET["num"]) ? $num = 0 : $num = $_GET["num"];

	if ($o != "svc_ok"){
		!isset($_GET["sort_types"]) ? $sort_types = $oreon->OptGen["problem_sort_type"] : $sort_types = $_GET["sort_types"];
		!isset($_GET["order"]) ? $order = "SORT_".$oreon->OptGen["problem_sort_order"] : $order = $_GET["order"];
	} else {
		$sort_types = "host_name";
		$order = "DESC";
	}
	
	# start quickSearch form
	include_once("./include/common/quickSearch.php");
	# end quickSearch form

	$tab_class = array("0" => "list_one", "1" => "list_two");
	$rows = 0;
	$service_status_num = array();
	if ($o == "svcpb"){
		if (isset($service_status))
			foreach ($service_status as $name => $svc){			
				$tmp = array();
				$tmp[0] = $name;
				if (strcmp($svc["current_state"], "OK")){
					$service_status[$name]["host_status"] = $host_status[$service_status[$name]["host_name"]]["current_state"];
					$service_status[$name]["host_color"] = $oreon->optGen["color_".strtolower($service_status[$name]["host_status"])];
					$service_status[$name]["status_color"] = $oreon->optGen["color_".strtolower($svc["current_state"])];
					if ($svc["last_check"]){
						$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
						$service_status[$name]["last_state_change"] = Duration::toString(time() - $svc["last_state_change"]);
					} else {
						$service_status[$name]["last_check"] = "";
						$service_status[$name]["last_state_change"] = "";
					}
					$service_status[$name]["class"] = $tab_class[$rows % 2];
					$tmp[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp;
				}
			}
			$service_status_num = array();
			$rows = 0;
			$tmp = array();
			foreach ($service_status as $name => $svc)
				if($service_status[$name]["current_state"] != 'OK'){
					$tmp2 = array();
					$tmp2[0] = $name;		
					$tmp[$name] = $service_status[$name];
					$tmp2[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp2;
				}
	} else {
		$tab = array("svc_warning" => "WARNING", "svc_unknown" => "UNKNOWN", "svc_critical" => "CRITICAL", "svc_ok" => "OK");
		if (isset($service_status))
			foreach ($service_status as $name => $svc){		
				$tmp = array();
				$tmp[0] = $name;
				if (!strcmp($svc["current_state"], $tab[$o]) && (!isset($_GET["host_name"]) || (isset($_GET["host_name"]) && $service_status[$name]["host_name"] == $_GET["host_name"]))){
					$service_status[$name]["host_status"] = $host_status[$service_status[$name]["host_name"]]["current_state"];
					$service_status[$name]["host_color"] = $oreon->optGen["color_".strtolower($service_status[$name]["host_status"])];
					$service_status[$name]["status_color"] = $oreon->optGen["color_".strtolower($svc["current_state"])];
					if ($svc["last_check"]){
						$service_status[$name]["last_check"] = date($lang["date_time_format_status"], $svc["last_check"]);
						$service_status[$name]["last_state_change"] = Duration::toString(time() - $svc["last_state_change"]);
					} else {
						$service_status[$name]["last_check"] = "";
						$service_status[$name]["last_state_change"] = "";
					}
					$service_status[$name]["class"] = $tab_class[$rows % 2];
					$tmp[1] = $service_status[$name];
					$service_status_num[$rows++] = $tmp;
				} else
					unset($service_status[$name]);
			}
		$service_status_num = array();
		$rows = 0;
		$tmp = array();
		foreach ($service_status as $name => $svc)
			if($service_status[$name]["current_state"] == $tab[$o]){
				$tmp2 = array();
				$tmp2[0] = $name;		
				$tmp[$name] = $service_status[$name];
				$tmp2[1] = $service_status[$name];
				$service_status_num[$rows++] = $tmp2;
{'fraction_non_alphanumeric': 0.1978033364418195, 'fraction_numerical': 0.005595275101025801, 'mean_word_length': 4.995031055900621, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6269398', 'n_tokens_mistral': 3823, 'n_tokens_neox': 3330, 'n_words': 642}