jackburton79 / ocs-agent

Lite inventory agent (compatibile with ocsinventory-ng and glpi)
GNU General Public License v3.0
15 stars 6 forks source link

our OCS server disconnect after send Prolog #2

Closed sqnoc closed 10 years ago

sqnoc commented 10 years ago

The state is not tested during connection. Our OCS server disconnect after send prolog xml file. As a result Inventory xml file is not send. To send inventory file i add new connection (httpObject2).

jackburton79 commented 10 years ago

I need a bit more information: the fact that your OCS server disconnect after sending prolog is a configuration specific to your server ? When you say "The state is not tested during connection." you mean the state of the connection, I guess.

jackburton79 commented 10 years ago

I added a check for the connection state in 46669b397efb87b4bc86f9039099917b06ec4d0a. Could you check if the problem persists ?

jackburton79 commented 10 years ago

Sorry, my bad. I reverted the change since getpeername() doesn't work as stated in the docs.

sqnoc commented 10 years ago

it's may caused by our Apache server configuration (keep-alive). We are captured this packets with WireShark:

ocsinventory-agent -c /etc/ocsinventory-agent.cfg

POST /ocsinventory HTTP/1.1 Host: ocsinventory-ng.domain.fr User-Agent: OCS-NG_unified_unix_agent_v2.0.5 Connection: Keep-Alive, TE Content-Length: 119 Content-Type: application/x-compress Keep-Alive: 300 Pragma: no-cache TE: deflate, gzip

HTTP/1.1 200 OK Cache-control: no-cache Connection: close content-length: 628 Content-Type: application/x-compressed

Date: Thu, 14 Aug 2014 08:16:47 GMT Server: Apache/2.2.3 (CentOS) proxy_html/3.1.2 mod_ssl/2.2.3 OpenSSL/0.9.8e-fips-rhel5 mod_perl/2.0.4 Perl/v5.8.8 <?xml version='1.0' encoding='UTF-8'?>

No support registered for your installation. Check OCS Inventory NG support packages at http://www.ocsinventory-ng.com SEND 2

POST /ocsinventory HTTP/1.1 Host: ocsinventory-ng.domain.fr User-Agent: OCS-NG_unified_unix_agent_v2.0.5 Connection: Keep-Alive, TE Content-Length: 1961 Content-Type: application/x-compress Keep-Alive: 300 Pragma: no-cache TE: deflate, gzip


Le 26/08/2014 10:37, Stefano Ceccherini a écrit :

I need a bit more information: the fact that your OCS server disconnect after sending prolog is a configuration specific to your server ? When you say "The state is not tested during connection." you mean the state of the connection, I guess.


Reply to this email directly or view it on GitHub https://github.com/jackburton79/agent/pull/2#issuecomment-53390848.

jackburton79 commented 10 years ago

It's fixed in d8022890b79b84ee790a5cd21d27d29c627caa29 (tested with my apache server with "KeepAlive Off", I could definitely reproduce the problem.)

sqnoc commented 10 years ago

wonderfull job. I'm work to add model monitor (Caption) ...

Le 27/08/2014 11:59, Stefano Ceccherini a écrit :

It's fixed in d802289 https://github.com/jackburton79/agent/commit/d8022890b79b84ee790a5cd21d27d29c627caa29. I think I introduced a problem in 417414d https://github.com/jackburton79/agent/commit/417414db7be78db6f3c0847bc485ed6f618357b0 though, in which the inventory isn't sent correctly every time. Fixing.


Reply to this email directly or view it on GitHub https://github.com/jackburton79/agent/pull/2#issuecomment-53549157.