2010-05-13 Raul Mateos <raulofpandora@gmail.com>

* operation/agentes/group_view.php: Clean code. Close tags. Now, if 
	there's no agent, it shows a text. Inefficient?
	* godmode/agentes/agent_manager: Solved typo with .png files, but
	those files doesn't exists in repository...
	*  ChangeLog: Changed date error from my last commit.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2725 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2010-05-13 18:29:46 +00:00
parent faa960ef84
commit 16c2d2e811
3 changed files with 51 additions and 20 deletions

View File

@ -1,4 +1,12 @@
2010-05-11 Raúl Mateos <raulofpandora@gmail.com> 2010-05-13 Raúl Mateos <raulofpandora@gmail.com>
* operation/agentes/group_view.php: Clean code. Close tags. Now, if
there's no agent, it shows a text. Inefficient?
* godmode/agentes/agent_manager: Solved typo with .png files, but
those files doesn't exists in repository...
2010-05-13 Raúl Mateos <raulofpandora@gmail.com>
* install.php: Updated year. Clean code. * install.php: Updated year. Clean code.

View File

@ -212,11 +212,11 @@ $path = 'images/gis_map/icons/'; //TODO set better method the path
$table->data[12][0] = __('Agent icon'); $table->data[12][0] = __('Agent icon');
$table->data[12][1] = print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) . $table->data[12][1] = print_select($arraySelectIcon, "icon_path", $icon_path, "changeIcons();", __('None'), '', true) .
'&nbsp;' . __('Without status') . ': <img id="icon_without_status" src="' . $path . $icon_path . '.png" />' . '&nbsp;' . __('Without status') . ': <img id="icon_without_status" src="' . $path . $icon_path . 'none.png" />' .
'&nbsp;' . __('Default') . ': <img id="icon_default" src="' . $path . $icon_path . '.default.png" />' . '&nbsp;' . __('Default') . ': <img id="icon_default" src="' . $path . $icon_path . 'default.png" />' .
'&nbsp;' . __('Ok') . ': <img id="icon_ok" src="' . $path . $icon_path . '.ok.png" />' . '&nbsp;' . __('Ok') . ': <img id="icon_ok" src="' . $path . $icon_path . 'ok.png" />' .
'&nbsp;' . __('Bad') . ': <img id="icon_bad" src="' . $path . $icon_path . '.bad.png" />' . '&nbsp;' . __('Bad') . ': <img id="icon_bad" src="' . $path . $icon_path . 'bad.png" />' .
'&nbsp;' . __('Warning') . ': <img id="icon_warning" src="' . $path . $icon_path . '.warning.png" />'; '&nbsp;' . __('Warning') . ': <img id="icon_warning" src="' . $path . $icon_path . 'warning.png" />';
if ($config['activate_gis']) { if ($config['activate_gis']) {
$table->data[13][0] = __('Ignore new GIS data:'); $table->data[13][0] = __('Ignore new GIS data:');

View File

@ -61,18 +61,30 @@ $counter = 1;
// Old style table, we need a lot of special formatting,don't use table function // Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table // Prepare old-style table
foreach ($groups as $id_group) {
$data = get_group_stats($id_group);
if ($data["total_agents"] == 0) {
$agents = 0;
} else {
$agents = 1;
}
}
if ($agents == 1) {
echo '<table cellpadding="0" cellspacing="0" border="0" width="98%">'; echo '<table cellpadding="0" cellspacing="0" border="0" width="98%">';
echo "<tr>"; echo "<tr>";
echo "<th width='20%''>".__("Group"); echo "<th width='20%'>".__("Group")."</th>";
echo "<th width='10%'>".__("Agents"); echo "<th width='10%'>".__("Agents")."</th>";
echo "<th width='10%'>".__("Agent unknown"); echo "<th width='10%'>".__("Agent unknown")."</th>";
echo "<th width='10%'>".__("Unknown"); echo "<th width='10%'>".__("Unknown")."</th>";
echo "<th width='10%'>".__("Not Init"); echo "<th width='10%'>".__("Not Init")."</th>";
echo "<th width='10%'>".__("Normal"); echo "<th width='10%'>".__("Normal")."</th>";
echo "<th width='10%'>".__("Warning"); echo "<th width='10%'>".__("Warning")."</th>";
echo "<th width='10%'>".__("Critical"); echo "<th width='10%'>".__("Critical")."</th>";
echo "<th width='10%'>".__("Alert fired"); echo "<th width='10%'>".__("Alert fired")."</th>";
// For each valid group for this user, take data from agent and modules // For each valid group for this user, take data from agent and modules
foreach ($groups as $id_group => $group_name) { foreach ($groups as $id_group => $group_name) {
@ -112,7 +124,7 @@ foreach ($groups as $id_group => $group_name) {
echo '&nbsp;<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$id_group.'"><img src="images/target.png" align="right"></a>'; echo '&nbsp;<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$id_group.'"><img src="images/target.png" align="right"></a>';
echo "&nbsp;"; echo "&nbsp;";
} }
echo "</td>";
// Total agents // Total agents
echo "<td style='font-weight: bold; font-size: 18px;'>"; echo "<td style='font-weight: bold; font-size: 18px;'>";
@ -124,6 +136,7 @@ foreach ($groups as $id_group => $group_name) {
if ($data["agents_unknown"] > 0) { if ($data["agents_unknown"] > 0) {
echo "<td style='font-weight: bold; font-size: 18px; color: #886666;'>"; echo "<td style='font-weight: bold; font-size: 18px; color: #886666;'>";
echo $data["agents_unknown"]; echo $data["agents_unknown"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
@ -132,6 +145,7 @@ foreach ($groups as $id_group => $group_name) {
if ($data["monitor_unknown"] > 0){ if ($data["monitor_unknown"] > 0){
echo "<td style='font-weight: bold; font-size: 18px; color: #666;'>"; echo "<td style='font-weight: bold; font-size: 18px; color: #666;'>";
echo $data["monitor_unknown"]; echo $data["monitor_unknown"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
@ -141,6 +155,7 @@ foreach ($groups as $id_group => $group_name) {
if ($data["monitor_non_init"] > 0){ if ($data["monitor_non_init"] > 0){
echo "<td style='font-weight: bold; font-size: 18px; color #666;'>"; echo "<td style='font-weight: bold; font-size: 18px; color #666;'>";
echo $data["monitor_non_init"]; echo $data["monitor_non_init"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
@ -152,11 +167,13 @@ foreach ($groups as $id_group => $group_name) {
echo $data["monitor_ok"]; echo $data["monitor_ok"];
else else
echo "&nbsp;"; echo "&nbsp;";
echo "</td>";
// Monitors Warning // Monitors Warning
if ($data["monitor_warning"] > 0){ if ($data["monitor_warning"] > 0){
echo "<td style='font-weight: bold; font-size: 18px; color: #aba900;'>"; echo "<td style='font-weight: bold; font-size: 18px; color: #aba900;'>";
echo $data["monitor_warning"]; echo $data["monitor_warning"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
@ -165,6 +182,7 @@ foreach ($groups as $id_group => $group_name) {
if ($data["monitor_critical"] > 0){ if ($data["monitor_critical"] > 0){
echo "<td style='font-weight: bold; font-size: 18px; color: #bc0000'>"; echo "<td style='font-weight: bold; font-size: 18px; color: #bc0000'>";
echo $data["monitor_critical"]; echo $data["monitor_critical"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
@ -172,16 +190,21 @@ foreach ($groups as $id_group => $group_name) {
if ($data["monitor_alerts_fired"] > 0){ if ($data["monitor_alerts_fired"] > 0){
echo "<td style='font-weight: bold; font-size: 18px; color: #8b01ae;'>"; echo "<td style='font-weight: bold; font-size: 18px; color: #8b01ae;'>";
echo $data["monitor_alerts_fired"]; echo $data["monitor_alerts_fired"];
echo "</td>";
} else { } else {
echo "<td></td>"; echo "<td></td>";
} }
echo "</tr>"; echo "</tr>";
echo "<tr style='height: 5px;'><td colspan=10> </td>"; echo "<tr style='height: 5px;'><td colspan=10> </td></tr>";
} }
echo "</table>"; echo "</table>";
} else {
echo "<div class='nf'>".__('There are no defined agents')."</div>";
}
?> ?>