Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Troubleshooting 403 errors in agent checkin

New install of ocsinventory, all modules on the same (debian) server.  /ocs-reports seems to be working fine now, but when I install the agent on a test machine it can't reach the server module located at /ocsinventory

The relevant line in the agent logs is:

ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #403>

I've also tried manually pointing a browser at http://x.x.x.x/ocsinventory and I do indeed get a 403 error.  When I do the same from the server itself I get a blank page, which I assume is intended.

I do not have a firewall or any network-level blocks between the agent computer and the server.  I assume I have misconfigured something.

If I compare permissions between /usr/share/ocsinventory-reports and /usr/share/ocsinventory-server, the only difference is that /ocsinventory-reports is owned by www-data www-data and ocsinventory-server is owned by root root.  Is it possible that's the source of my problem? I'm hesitant to just go changing owners without fully understanding who the owner is *supposed* to be.
in OCS Inventory NG server for Unix by (330 points)

3 Answers

0 votes

Went ahead and changed those permissions, to no avail.

Confirmed that ocsinventory-server.conf and z_ocsinventory-server.conf are the only files that touch the <location> /ocsinventory and they still have the default config:

---snip---

  1. <Location /ocsinventory>
  2. <IfModule mod_authz_core.c>
  3. # Apache 2.4
  4. Require all granted
  5. </IfModule>
  6. <IfModule !mod_authz_core.c>
  7. # Apache 2.2
  8. order deny,allow
  9. allow from all
  10. </IfModule>
---snip---
ago by (330 points)
0 votes
Where is yours checks of Apache configuration and Apache access log files ? Without these checks, there is no chance to solve ...

Please check : apache2ctl -S and access.log
ago by (20.8k points)
0 votes

Hi and thanks again Jacquesh, requested file snips are below:

Access.log: blank file. I think you may be more interested in...

Other_vhosts_access.log:

localhost:80 192.168.1.198 - - [20/Jun/2025:08:36:32 -0500] "GET /ocsinventory/deploy/label HTTP/1.1" 403 154 "-" "OCS-NG_WINDOWS_AGENT_v2.11.0.1"

localhost:80 192.168.1.198 - - [20/Jun/2025:08:36:32 -0500] "POST /ocsinventory HTTP/1.1" 403 154 "-" "OCS-NG_WINDOWS_AGENT_v2.11.0.1"

Apache2ctl -S output:

ocsinventory-server: Bad setting. `SNMP_LINK_TAG` is not set. Default: `0`

ocsinventory-server: Bad setting. `SCAN_TYPE_IPDISCOVER` is not set. Default: `ICMP`

ocsinventory-server: Bad setting. `SCAN_ARP_BANDWIDTH` is not set. Default: `256`

ocsinventory-server: Bad setting. `IPDISCOVER_LINK_TAG_NETWORK` is not set. Default: `0`

ocsinventory-server: Bad setting. `GENERATE_OCS_FILES_SNMP` is not set. Default: `0`

ocsinventory-server: Bad setting. `SCAN_TYPE_SNMP` is not set. Default: `ICMP`

VirtualHost configuration:

*:80                   localhost (/etc/apache2/sites-enabled/glpi.conf:1)

ServerRoot: "/etc/apache2"

Main DocumentRoot: "/var/www/html"

Main ErrorLog: "/var/log/apache2/error.log"

Mutex mpm-accept: using_defaults

Mutex watchdog-callback: using_defaults

Mutex rewrite-map: using_defaults

Mutex default: dir="/var/run/apache2/" mechanism=default 

PidFile: "/var/run/apache2/apache2.pid"

Define: DUMP_VHOSTS

Define: DUMP_RUN_CFG

Define: MODPERL2

User: name="www-data" id=33

Group: name="www-data" id=33

Bonus, Error.log:
ago by (330 points)
 
Powered by Question2Answer
...