diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3554abf5ed..4773b88938 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-08-26 Miguel de Dios + + * pandoradb.data.postgreSQL.sql, pandoradb.data.oracle.sql, + pandoradb_data.sql: fixed the id_alert_command for restart the + agent set 11 (before it was 10). + +2013-08-26 Miguel de Dios + + * extensions/update_manager/lib/xmlrpc/xmlrpc.inc: fixed the timeout + for to check packages of pandora update manager. + 2013-08-26 Miguel de Dios * godmode/agentes/module_manager_editor.php, diff --git a/pandora_console/extensions/update_manager/lib/xmlrpc/xmlrpc.inc b/pandora_console/extensions/update_manager/lib/xmlrpc/xmlrpc.inc index 29fe9984a4..108f72ae9e 100755 --- a/pandora_console/extensions/update_manager/lib/xmlrpc/xmlrpc.inc +++ b/pandora_console/extensions/update_manager/lib/xmlrpc/xmlrpc.inc @@ -1273,6 +1273,7 @@ $username='', $password='', $authtype=1, $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1) { + if($port==0) { $port=80; @@ -1401,7 +1402,8 @@ // let the client see this now in case http times out... flush(); } - + + if($timeout>0) { $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr, $timeout); @@ -1410,29 +1412,30 @@ { $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr); } + if($fp) - { + { if($timeout>0 && function_exists('stream_set_timeout')) { stream_set_timeout($fp, $timeout); } } else - { + { $this->errstr='Connect error: '.$this->errstr; $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr . ' (' . $this->errno . ')'); return $r; } - + if(!fputs($fp, $op, strlen($op))) - { + { fclose($fp); $this->errstr='Write error'; $r=new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr); return $r; } else - { + { // reset errno and errstr on succesful socket connection $this->errstr = ''; } @@ -1444,6 +1447,11 @@ // shall we check for $data === FALSE? // as per the manual, it signals an error $ipd.=fread($fp, 32768); + $info = stream_get_meta_data($fp); + + if ($info['timed_out']) { + break; + } } while(!feof($fp)); fclose($fp); @@ -1491,6 +1499,7 @@ $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1, $keepalive=false, $key='', $keypass='') { + $r =& $this->sendPayloadCURL($msg, $server, $port, $timeout, $username, $password, $authtype, $cert, $certpass, $cacert, $cacertdir, $proxyhost, $proxyport, $proxyusername, $proxypassword, $proxyauthtype, 'https', $keepalive, $key, $keypass); diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 0174d9e4cf..bd94005429 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -1121,7 +1121,7 @@ END;; BEGIN LOCK TABLE talert_actions IN EXCLUSIVE MODE; INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); -INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (2,'Restart agent',10,'REFRESH AGENT *','','',0,0); +INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (2,'Restart agent',11,'REFRESH AGENT *','','',0,0); INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','',0,0); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 0ef11f8f6f..02a9ebaa13 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -1036,7 +1036,7 @@ INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands))); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); -INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (2,'Restart agent',10,'REFRESH AGENT *','','',0,0); +INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (2,'Restart agent',11,'REFRESH AGENT *','','',0,0); INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','',0,0); SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions))); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index a1118b2012..0fca76ea96 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -981,7 +981,7 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0); -INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (2,'Restart agent',10,'REFRESH AGENT *','','',0,0); +INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (2,'Restart agent',11,'REFRESH AGENT *','','',0,0); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (3,'Pandora FMS Event',3,'Event generated by alert','alert_fired','',0,0);