mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2008-06-19 Sancho Lerena <slerena@gmail.com>
* include/functions_reporting.php include/config.php include/functions.php include/functions_db.php operation/agentes/estado_grupo.php operation/agentes/estado_agente.php operation/agentes/estado_monitores.php operation/agentes/tactical.php operation/agentes/networkmap.php godmode/agentes/module_manager.php godmode/agentes/agent_manager.php: Several fixes for module disabled issue git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@884 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1a47cd15d4
commit
09f801adae
@ -1,3 +1,17 @@
|
|||||||
|
2008-06-19 Sancho Lerena <slerena@gmail.com>
|
||||||
|
|
||||||
|
* include/functions_reporting.php
|
||||||
|
include/config.php
|
||||||
|
include/functions.php
|
||||||
|
include/functions_db.php
|
||||||
|
operation/agentes/estado_grupo.php
|
||||||
|
operation/agentes/estado_agente.php
|
||||||
|
operation/agentes/estado_monitores.php
|
||||||
|
operation/agentes/tactical.php
|
||||||
|
operation/agentes/networkmap.php
|
||||||
|
godmode/agentes/module_manager.php
|
||||||
|
godmode/agentes/agent_manager.php: Several fixes for module disabled issue
|
||||||
|
|
||||||
2008-06-18 Esteban Sanchez <estebans@artica.es>
|
2008-06-18 Esteban Sanchez <estebans@artica.es>
|
||||||
|
|
||||||
* include/functions_db.php: Fixed an error on
|
* include/functions_db.php: Fixed an error on
|
||||||
|
@ -108,8 +108,7 @@ if ($create_agent != 1) {
|
|||||||
echo '<tr><td class="datos"><b>'.lang_string ("Parent").'</b>';
|
echo '<tr><td class="datos"><b>'.lang_string ("Parent").'</b>';
|
||||||
echo '<td class="datos">';
|
echo '<td class="datos">';
|
||||||
print_select_from_sql ('SELECT id_agente, nombre FROM tagente',
|
print_select_from_sql ('SELECT id_agente, nombre FROM tagente',
|
||||||
'id_parent', $id_parent, '', 'None', '0');
|
'id_parent', $id_parent, '', 'None', '0');
|
||||||
|
|
||||||
|
|
||||||
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b>';
|
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b>';
|
||||||
echo '<td class="datos"><select name="grupo" class="w130">';
|
echo '<td class="datos"><select name="grupo" class="w130">';
|
||||||
|
@ -102,7 +102,10 @@ if ($row=mysql_num_rows($result)){
|
|||||||
echo "<tr><td class='datos3' align='center' colspan='9'><b>".$nombre_grupomodulo."</b></td></tr>";
|
echo "<tr><td class='datos3' align='center' colspan='9'><b>".$nombre_grupomodulo."</b></td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<tr><td class='".$tdcolor."_id'>".$nombre_modulo."</td>";
|
if ($row["disabled"] == 0)
|
||||||
|
echo "<tr><td class='".$tdcolor."_id'>".$nombre_modulo."</td>";
|
||||||
|
else
|
||||||
|
echo "<tr><td class='$tdcolor'><i>$nombre_modulo</i></td>";
|
||||||
|
|
||||||
// Module type (by server type )
|
// Module type (by server type )
|
||||||
echo "<td class='".$tdcolor."f9'>";
|
echo "<td class='".$tdcolor."f9'>";
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
// Begin of automatic config file
|
// Begin of automatic config file
|
||||||
$config["dbname"]="pandora"; // MySQL DataBase name
|
$config["dbname"]="pandora"; // MySQL DataBase name
|
||||||
$config["dbuser"]="pandora"; // DB User
|
$config["dbuser"]="pandora"; // DB User
|
||||||
$config["dbpass"]="pandora"; // DB Password
|
$config["dbpass"]="dstxhvec"; // DB Password
|
||||||
$config["dbhost"]="localhost"; // DB Host
|
$config["dbhost"]="localhost"; // DB Host
|
||||||
$config["homedir"]="/var/www/pandora_console/"; // Config homedir
|
$config["homedir"]="/var/www/pandora/"; // Config homedir
|
||||||
$config["homeurl"]="http://localhost/pandora_console"; // Base URL
|
$config["homeurl"]="http://localhost/pandora"; // Base URL
|
||||||
|
|
||||||
// End of automatic config file
|
// End of automatic config file
|
||||||
?><?php
|
?><?php
|
||||||
// Pandora FMS - the Free Monitoring System
|
// Pandora FMS - the Free Monitoring System
|
||||||
@ -43,6 +44,5 @@ $config["homeurl"]="http://localhost/pandora_console"; // Base URL
|
|||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include ("config_process.php");
|
include ("config_process.php");
|
||||||
?>
|
?>
|
||||||
|
@ -165,7 +165,7 @@ function give_human_time ($int_seconds) {
|
|||||||
$build[] = $temp.' '.$key.($temp != 1 ? 's' : null);
|
$build[] = $temp.' '.$key.($temp != 1 ? 's' : null);
|
||||||
|
|
||||||
// set flag to false, to allow 0's in lower periods
|
// set flag to false, to allow 0's in lower periods
|
||||||
$flag_hide_zero = false;
|
$flag_hide_zero = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the remainder of seconds
|
// get the remainder of seconds
|
||||||
|
@ -943,27 +943,23 @@ function show_icon_type ($id_type) {
|
|||||||
* @param int Server type id
|
* @param int Server type id
|
||||||
* @return string Fully formatted IMG HTML tag with icon
|
* @return string Fully formatted IMG HTML tag with icon
|
||||||
*/
|
*/
|
||||||
function show_server_type ($id) {
|
<<<<<<< .mine
|
||||||
global $config;
|
|
||||||
switch ($id) {
|
function show_server_type ($id){
|
||||||
case 1:
|
global $config;
|
||||||
return '<img src="'.$config["homeurl"].'/images/data.png" title="Pandora FMS Data server">';
|
switch ($id) {
|
||||||
break;
|
case 1: return '<img src="images/data.png" title="Pandora FMS Data server">';
|
||||||
case 2:
|
break;
|
||||||
return '<img src="'.$config["homeurl"].'/images/network.png" title="Pandora FMS Network server">';
|
case 2: return '<img src="images/network.png" title="Pandora FMS Network server">';
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4: return '<img src="images/plugin.png" title="Pandora FMS Plugin server">';
|
||||||
return '<img src="'.$config["homeurl"].'/images/plugin.png" title="Pandora FMS Plugin server">';
|
break;
|
||||||
break;
|
case 5: return '<img src="images/chart_bar.png" title="Pandora FMS Prediction server">';
|
||||||
case 5:
|
break;
|
||||||
return '<img src="'.$config["homeurl"].'/images/chart_bar.png" title="Pandora FMS Prediction server">';
|
case 6: return '<img src="images/wmi.png" title="Pandora FMS WMI server">';
|
||||||
break;
|
break;
|
||||||
case 6:
|
default: return "--";
|
||||||
return '<img src="'.$config["homeurl"].'/images/wmi.png" title="Pandora FMS WMI server">';
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return "--";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +116,7 @@ function general_stats ( $id_user, $id_group = 0) {
|
|||||||
$existen_agentes = 1;
|
$existen_agentes = 1;
|
||||||
|
|
||||||
// SQL Join to get monitor status for agents belong this group
|
// SQL Join to get monitor status for agents belong this group
|
||||||
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo FROM tagente, tagente_estado WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente ";
|
$sql1 = "SELECT tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval, tagente_estado.utimestamp, tagente_estado.id_agente_modulo FROM tagente, tagente_estado, tagente_modulo WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND tagente.id_agente = tagente_estado.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.disabled = 0 ";
|
||||||
if ($result1 = mysql_query ($sql1)){
|
if ($result1 = mysql_query ($sql1)){
|
||||||
while ($row1 = mysql_fetch_array ($result1)) {
|
while ($row1 = mysql_fetch_array ($result1)) {
|
||||||
$id_agente = $row1[0];
|
$id_agente = $row1[0];
|
||||||
|
@ -165,9 +165,9 @@ if (comprueba_login() == 0) {
|
|||||||
if ($pertenece == 1) { // Si el agente pertenece a uno de los grupos que el usuario puede visualizar
|
if ($pertenece == 1) { // Si el agente pertenece a uno de los grupos que el usuario puede visualizar
|
||||||
// Obtenemos la lista de todos los modulos de cada agente
|
// Obtenemos la lista de todos los modulos de cada agente
|
||||||
$sql_t="SELECT * FROM tagente_estado, tagente_modulo
|
$sql_t="SELECT * FROM tagente_estado, tagente_modulo
|
||||||
WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND
|
||||||
|
tagente_modulo.disabled = 0
|
||||||
AND tagente_modulo.id_agente=".$id_agente;
|
AND tagente_modulo.id_agente=".$id_agente;
|
||||||
// $sql_t="SELECT * FROM tagente_estado WHERE id_agente=".$id_agente;
|
|
||||||
$result_t=mysql_query($sql_t);
|
$result_t=mysql_query($sql_t);
|
||||||
$estado_general = 0;
|
$estado_general = 0;
|
||||||
$numero_modulos = 0;
|
$numero_modulos = 0;
|
||||||
|
@ -79,9 +79,11 @@
|
|||||||
$sql1 = "SELECT
|
$sql1 = "SELECT
|
||||||
tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval,
|
tagente.id_agente, tagente_estado.estado, tagente_estado.datos, tagente_estado.current_interval,
|
||||||
tagente_estado.utimestamp, tagente_estado.id_agente_modulo
|
tagente_estado.utimestamp, tagente_estado.id_agente_modulo
|
||||||
FROM tagente, tagente_estado
|
FROM tagente, tagente_estado, tagente_modulo
|
||||||
WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND
|
WHERE tagente.disabled = 0 AND tagente.id_grupo = $migrupo AND
|
||||||
tagente.id_agente = tagente_estado.id_agente AND tagente_estado.estado != 100 AND
|
tagente.id_agente = tagente_estado.id_agente AND tagente_estado.estado != 100 AND
|
||||||
|
tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND
|
||||||
|
tagente_modulo.disabled = 0 AND
|
||||||
tagente_estado.utimestamp != 0";
|
tagente_estado.utimestamp != 0";
|
||||||
|
|
||||||
if ($result1 = mysql_query ($sql1)){
|
if ($result1 = mysql_query ($sql1)){
|
||||||
|
@ -24,7 +24,7 @@ if (comprueba_login() == 0) {
|
|||||||
$id_agente = $_GET["id_agente"];
|
$id_agente = $_GET["id_agente"];
|
||||||
}
|
}
|
||||||
// Get all module from agent
|
// Get all module from agent
|
||||||
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre';
|
$sql_t='SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_modulo.disabled = 0 AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente='.$id_agente.' AND tagente_estado.estado != 100 AND tagente_estado.utimestamp != 0 ORDER BY tagente_modulo.nombre';
|
||||||
$result_t=mysql_query($sql_t);
|
$result_t=mysql_query($sql_t);
|
||||||
if (mysql_num_rows ($result_t)) {
|
if (mysql_num_rows ($result_t)) {
|
||||||
echo "<h3>".$lang_label["monitor_listing"]."</h3>";
|
echo "<h3>".$lang_label["monitor_listing"]."</h3>";
|
||||||
|
@ -30,7 +30,7 @@ function generate_dot( $simple = 0) {
|
|||||||
$graph = open_graph();
|
$graph = open_graph();
|
||||||
|
|
||||||
// Get agent data
|
// Get agent data
|
||||||
$agents = mysql_query('SELECT * FROM tagente ORDER BY id_grupo');
|
$agents = mysql_query('SELECT * FROM tagente WHERE disabled = 0 ORDER BY id_grupo');
|
||||||
while ($agent = mysql_fetch_array($agents)) {
|
while ($agent = mysql_fetch_array($agents)) {
|
||||||
if (give_acl($config["id_user"], $agent["id_grupo"], "AR") == 0)
|
if (give_acl($config["id_user"], $agent["id_grupo"], "AR") == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -96,6 +96,7 @@ function create_node($agent, $simple = 0) {
|
|||||||
WHERE m.id_agente=' . $agent['id_agente'] .
|
WHERE m.id_agente=' . $agent['id_agente'] .
|
||||||
' AND m.id_tipo_modulo in (2, 6, 9, 18, 21, 100)
|
' AND m.id_tipo_modulo in (2, 6, 9, 18, 21, 100)
|
||||||
AND e.id_agente_modulo = m.id_agente_modulo
|
AND e.id_agente_modulo = m.id_agente_modulo
|
||||||
|
AND m.disabled = 0
|
||||||
AND e.estado = 1');
|
AND e.estado = 1');
|
||||||
|
|
||||||
// Set node status
|
// Set node status
|
||||||
@ -169,8 +170,8 @@ function close_group() {
|
|||||||
function open_graph() {
|
function open_graph() {
|
||||||
global $config, $layout, $nooverlap, $pure, $zoom, $ranksep;
|
global $config, $layout, $nooverlap, $pure, $zoom, $ranksep;
|
||||||
$overlap = 'compress';
|
$overlap = 'compress';
|
||||||
$size_x = 8.1;
|
$size_x = 8;
|
||||||
$size_y = 6.5;
|
$size_y = 5.4;
|
||||||
$size = '';
|
$size = '';
|
||||||
|
|
||||||
if ($layout == '' || $layout == 'radial') {
|
if ($layout == '' || $layout == 'radial') {
|
||||||
|
@ -159,7 +159,7 @@
|
|||||||
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_checks;
|
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_checks;
|
||||||
|
|
||||||
echo "<tr><td class='datos2'><b>"."Server sanity"."</b></td>";
|
echo "<tr><td class='datos2'><b>"."Server sanity"."</b></td>";
|
||||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'";
|
echo "<td class='datos2' style='font: bold 1em Arial, Sans-serif; color: #000;'>";
|
||||||
echo format_numeric($notinit_percentage);
|
echo format_numeric($notinit_percentage);
|
||||||
echo "% ".lang_string("Uninitialized modules");
|
echo "% ".lang_string("Uninitialized modules");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user