From 6586e86d59534b6e10a80f46cc1117165fbd1d5c Mon Sep 17 00:00:00 2001 From: slerena Date: Tue, 8 Jan 2008 18:49:39 +0000 Subject: [PATCH] 2008-01-08 Sancho Lerena * pandoradb_data.sql: Added keep_alive as module id 100 for the new keepalive management. Old way (from 1.2) is now deprecated and not used. * operation/agentes/estado_agente.php: Style changes, not code. * images/mod_keepalive.png: Added new icon for keepalive moduletype. * godmode/agentes/configurar_agente.php: Create an agent creates automatically a keepalive module AND a tagente_estado record. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@688 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 12 ++++++++++++ .../godmode/agentes/configurar_agente.php | 8 +++++++- pandora_console/images/mod_keepalive.png | Bin 0 -> 595 bytes .../operation/agentes/estado_agente.php | 4 ++-- pandora_console/pandoradb_data.sql | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 pandora_console/images/mod_keepalive.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9de07203db..49506fb7a0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2008-01-08 Sancho Lerena + + * pandoradb_data.sql: Added keep_alive as module id 100 for the new keepalive + management. Old way (from 1.2) is now deprecated and not used. + + * operation/agentes/estado_agente.php: Style changes, not code. + + * images/mod_keepalive.png: Added new icon for keepalive moduletype. + + * godmode/agentes/configurar_agente.php: Create an agent creates automatically + a keepalive module AND a tagente_estado record. + 2007-12-16 Sancho Lerena * pandoradb.sql: New field for tagente_modulo: disabled, to be diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 74398ea537..bd5e5ff488 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -118,8 +118,14 @@ if (isset($_POST["create_agent"])) { // Create a new and shining agent $agent_created_ok = 1; $id_agente = mysql_insert_id(); // Create special MODULE agent_keepalive - $sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",-1,'Agent Keepalive monitor')"; + $sql_insert ="INSERT INTO tagente_modulo (nombre, id_agente, id_tipo_modulo, descripcion) VALUES ('agent_keepalive', ".$id_agente.",100,'Agent Keepalive monitor')"; $result=mysql_query($sql_insert); + $id_agent_module = mysql_insert_id(); + + // And create MODULE agent_keepalive in tagente_estado table + $sql_insert2 ="INSERT INTO tagente_estado (id_agente_modulo, datos, timestamp, cambio, estado, id_agente, last_try, utimestamp, current_interval, running_by, last_execution_try) VALUES ($id_agent_module, 1, '', 0, 1, $id_agente, 0,0,0,0,0)"; + $result = mysql_query ($sql_insert2); + // Create address for this agent in taddress agent_add_address ($id_agente, $direccion_agente); } diff --git a/pandora_console/images/mod_keepalive.png b/pandora_console/images/mod_keepalive.png new file mode 100644 index 0000000000000000000000000000000000000000..56626132fcdac4be06068289864c0624f03597df GIT binary patch literal 595 zcmV-Z0<8UsP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iO4! z5jHlFFZdP!00GlUL_t(Y$L&?IYTHm0J@-jQ4((tkIA4&EUunE%>00oZq5YDqg;ENE z1`l>-LzfQ4A7R`MH6Aj1%=bm$~#I|i793H{d z9yUcB$8hg%Fb#Y`MUdw19^YRM&>MW(_#@N6$A{hIs1nj@wKy7$(xg^_WWp&Q-)^@t91g2gB%kCmLXAd405Dq!0B~KGWxTU- znKLPflQr%ZgqUxXNrGfrb(6%&uEX&B1)|<5g0o|sG#oy-?oq@r6E=y7v5+GoB55Mo zyARFmN&t>V+SRbDy#fogUXK3mBCNyke}ay5WqBs0f4?6NWU9!4eQMNqYl6?m`Gfw%4;YrrQ_GMiip6nEO?$rrBq5X zv#7N;iO*mBf-_k*M*kotuL#LhjUp9DB8s9?qH}Vy*{sq(yREfGr_+IDSqn;-xJx002ovPDHLkV1iig0oDKj literal 0 HcmV?d00001 diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index a7aad4ba0e..c0045ca1e0 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -177,11 +177,11 @@ if (comprueba_login() == 0) { $numero_monitor++; $monitor_down++; } - elseif ($est_modulo <> 100) { // estado=100 are data modules + elseif ($est_modulo != 100) { // estado=100 are data modules $estado_general = $estado_general + $est_modulo; $estado_cambio = $estado_cambio + $row_t["cambio"]; $numero_monitor ++; - if ($est_modulo <> 0) + if ($est_modulo != 0) $monitor_bad++; else $monitor_ok++; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 21a6e8f59a..7353ac5a69 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -161,7 +161,7 @@ INSERT INTO `torigen` VALUES ('Operating System event'),('IDS events'),('Firewal -- Dumping data for table `ttipo_modulo` -- -INSERT INTO `ttipo_modulo` VALUES (1,'generic_data',0,'Generic module to adquire numeric data','mod_data.png'),(2,'generic_proc',1,'Generic module to adquire boolean data','mod_proc.png'),(3,'generic_data_string',0,'Generic module to adquire alphanumeric data','mod_string.png'),(4,'generic_data_inc',0,'Generic module to adquire numeric incremental data','mod_data_inc.png'),(6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png'),(7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png'),(8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png'),(9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png'),(10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png'),(11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png'),(15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png'),(16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'),(17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'),(18,'remote_snmp_proc',1,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'); +INSERT INTO `ttipo_modulo` VALUES (1,'generic_data',0,'Generic module to adquire numeric data','mod_data.png'),(2,'generic_proc',1,'Generic module to adquire boolean data','mod_proc.png'),(3,'generic_data_string',0,'Generic module to adquire alphanumeric data','mod_string.png'),(4,'generic_data_inc',0,'Generic module to adquire numeric incremental data','mod_data_inc.png'),(6,'remote_icmp_proc',3,'Remote ICMP network agent, boolean data','mod_icmp_proc.png'),(7,'remote_icmp',2,'Remote ICMP network agent (latency)','mod_icmp_data.png'),(8,'remote_tcp',2,'Remote TCP network agent, numeric data','mod_tcp_data.png'),(9,'remote_tcp_proc',3,'Remote TCP network agent, boolean data','mod_tcp_proc.png'),(10,'remote_tcp_string',2,'Remote TCP network agent, alphanumeric data','mod_tcp_string.png'),(11,'remote_tcp_inc',2,'Remote TCP network agent, incremental data','mod_tcp_inc.png'),(15,'remote_snmp',2,'Remote SNMP network agent, numeric data','mod_snmp_data.png'),(16,'remote_snmp_inc',2,'Remote SNMP network agent, incremental data','mod_snmp_inc.png'),(17,'remote_snmp_string',2,'Remote SNMP network agent, alphanumeric data','mod_snmp_string.png'),(18,'remote_snmp_proc',1,'Remote SNMP network agent, boolean data','mod_snmp_proc.png'), (100,'keep_alive',-1,'KeepAlive','mod_keepalive.png'); -- -- Dumping data for table `tusuario`