2009-03-25 Sancho Lerena <slerena@artica.es>

* estado_agente.php: Correct agent down status bug. Added search
	on description also, and search text parameter is moved on pagination links
	
	* estado_generalagente.php: Agent access graph has more height now.
	
	* event_statistics.php: removed unnecesary header. Better layout.

	* include/functions.php: human_time_description_raw() return "now" when
	data is 0 or empty.
	
	* db/db_main.php: Bigger graph.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1565 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-03-25 20:07:09 +00:00
parent 090b0661a5
commit 20fc304447
6 changed files with 44 additions and 24 deletions

View File

@ -1,3 +1,17 @@
2009-03-25 Sancho Lerena <slerena@artica.es>
* estado_agente.php: Correct agent down status bug. Added search
on description also, and search text parameter is moved on pagination links
* estado_generalagente.php: Agent access graph has more height now.
* event_statistics.php: removed unnecesary header. Better layout.
* include/functions.php: human_time_description_raw() return "now" when
data is 0 or empty.
* db/db_main.php: Bigger graph.
2009-03-25 Evi Vanoost <vanooste@rcbi.rochester.edu>
* include/functions_db.php: Made get_server_info more informational

View File

@ -47,7 +47,7 @@ echo '<h2>'.__('Database Maintenance').' &gt; '.__('Current database maintenance
<div align="justify">
'.__('Please check your Pandora Server setup and be sure that database maintenance daemon is running. It\'s very important to keep up-to-date database to get the best performance and results in Pandora').'
</div><br />
<img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1">
<img src="reporting/fgraph.php?tipo=db_agente_purge&id=-1&height=250&width=490">
</td></tr>
</table>';
?>

View File

@ -377,7 +377,7 @@ function human_time_comparation ($timestamp) {
}
$seconds = get_system_time () - $timestamp;
return human_time_description_raw ($seconds);
}
@ -413,8 +413,12 @@ function get_system_time () {
* @return string A human readable translation of minutes.
*/
function human_time_description_raw ($seconds) {
if (empty ($seconds)) {
return __('Unknown');
return __('Now');
// slerena 25/03/09
// Most times $seconds is empty is because last contact is current date
// Put here "uknown" or N/A or something similar is not a good idea
}
if ($seconds < 60)

View File

@ -50,8 +50,7 @@ $offset = get_parameter ("offset", 0);
$group_id = get_parameter ("group_id", 0);
$ag_group = get_parameter ("ag_group", $group_id);
$ag_group = get_parameter_get ("ag_group_refresh", $ag_group); //if it isn't set, defaults to prev. value
$search = get_parameter ("search");
$search = get_parameter ("search", "");
echo "<h2>".__('Pandora Agents')." &gt; ".__('Summary')."</h2>";
@ -84,7 +83,7 @@ value='".__('Show')."'>
echo __('Free text for search (*)');
echo "</td><td valign='top'>";
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60'>";
echo "<input type=text name='search' size='15'>";
echo "<input type=text name='search' value='$search' size='15'>";
echo "</td><td valign='top'>";
echo "<input name='srcbutton' type='submit' class='sub'
value='".__('Search')."'>";
@ -93,7 +92,7 @@ echo "</td></table>";
if ($search != ""){
$search_sql = " AND nombre LIKE '%$search%' OR direccion LIKE '%$search%' ";
$search_sql = " AND ( nombre LIKE '%$search%' OR comentarios LIKE '%$search%' OR direccion LIKE '%$search%' ) ";
} else {
$search_sql = "";
}
@ -155,7 +154,7 @@ $total_events = $row2[0];
// Prepare pagination
pagination ($total_events,
"index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60",
"index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$ag_group&refr=60&search=$search",
$offset);
// Show data.
$agents = get_db_all_rows_sql ($sql);
@ -181,6 +180,14 @@ if ($agents !== false) {
$id_os = $agent["id_os"];
$ultimo_contacto = $agent["ultimo_contacto"];
$biginterval = $intervalo;
// New check for agent down only based on last contact
$diff_agent_down = get_system_time () - strtotime ($agent["ultimo_contacto"]);
if ($diff_agent_down > $intervalo * 2)
$agent_down = 1;
else
$agent_down = 0;
$belongs = false;
//Verifiy if the group this agent begins is one of the user groups
foreach ($groups as $migrupo) {
@ -206,7 +213,6 @@ if ($agents !== false) {
$monitor_warning = 0;
$monitor_critical = 0;
$monitor_down = 0;
$agent_down = 0;
$now = get_system_time ();
// Calculate module/monitor totals for this agent
@ -233,7 +239,7 @@ if ($agents !== false) {
}
// Defines if Agent is down (interval x 2 > time last contact
if (($seconds >= ($intervalo_comp * 2)) && ($module_type < 21)) { // If (intervalx2) secs. ago we don't get anything, show alert
$agent_down = 1;
if ($async == 0)
$monitor_down++;
} else {
@ -288,15 +294,15 @@ if ($agents !== false) {
echo "</a>";
echo "<td class='$tdcolor'><b>".$numero_modulos." : ";
echo "<td class='$tdcolor'><b>".$numero_modulos." ";
if ($monitor_normal > 0)
echo " <span class='green'>".$monitor_normal."</span>";
echo " <span class='green'> : ".$monitor_normal." </span>";
if ($monitor_warning > 0)
echo " <span class='yellow'>".$monitor_warning."</span>";
echo " <span class='yellow'> : ".$monitor_warning." </span>";
if ($monitor_critical > 0)
echo " <span class='red'>".$monitor_critical."</span>";
echo " <span class='red'> : ".$monitor_critical." </span>";
if ($monitor_down > 0)
echo " <span class='grey'>".$monitor_down."</span>";
echo " <span class='grey'> : ".$monitor_down."</span>";
echo "</td>";
echo "<td class='$tdcolor' align='center'>";

View File

@ -44,12 +44,12 @@ echo "<h2>".__('Pandora Agents')." &gt; ".__('Agent general information')."</h2>
echo '<div style="height: 10px">&nbsp;</div>';
//Floating div
echo '<div style="float:right; width:300px; padding-top:16px;">';
echo '<b>'.__('Agent access rate (24h)').'</b><br /><br />';
echo '<img border="1" src="reporting/fgraph.php?id='.$id_agente.'&tipo=agentaccess&periodo=1440&height=70&width=280" />';
echo '<div style="float:right; width:320px; padding-top:11px;">';
echo '<b>'.__('Agent access rate (24h)').'</b><br />';
echo '<img border="1" src="reporting/fgraph.php?id='.$id_agente.'&tipo=agentaccess&periodo=1440&height=90&width=290" />';
echo '<div style="height:25px">&nbsp;</div>';
echo '<b>'.__('Events generated -by module-').'</b><br /><br />';
echo '<img border="1" src="reporting/fgraph.php?tipo=event_module&width=250&height=180&id_agent='.$id_agente.'" />';
echo '<b>'.__('Events generated -by module-').'</b><br />';
echo '<img border="1" src="reporting/fgraph.php?tipo=event_module&width=290&height=180&id_agent='.$id_agente.'" />';
echo '</div>';
echo '<div width="450px">';

View File

@ -27,10 +27,6 @@ if (! give_acl ($config['id_user'], 0, "AR")) {
require ("general/noaccess.php");
return;
}
echo "<h2>".__('Events')." &gt; ";
echo __('Events statistics')."</h2>";
echo "<br><br>";
echo "<table width=95%>";
echo "<tr><td valign='top'>";
echo "<h3>".__('Event graph')."</h3>";