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.11.1 available

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

<solved> Debian 10 vhost [closed]

Greethings,

several years ago a collegue of mine installed OCS in our company. Sadly nobody accualy used it till 3 months. Now i recognized the Version is pretty old and even it's OS is no longer supported.

So i decided to install a new one.

Therefore i've chosen an allready existing Debian 10 Webserver.

My VHost is called "ocs.localdomain.tld".

It's location on the server itself is "/opt/ocs.localdomain.tld/ocsreports"

I wanted to cut off the "/ocsreports"-suffix from the url wich acctually works, i guess.

But my agents aren't able to connect to the server.

Here is a short snippit from it's logfile:


==============================================================================
Starting OCS Inventory NG Agent on Tuesday, May 12, 2020 17:12:38.
AGENT => Running OCS Inventory NG Agent Version 2.6.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.6.0.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.6.0.0>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <w10x64-2020-03-17-13-02-00> and MACs <D2:D5:53:18:A1:6C> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Disabling cURL SSL server validation support
    COM SERVER => Sending HTTP Post request to URL <http://ocs.localdomain.tld>
    WARNING *** COM SERVER => Failed to send HTTP Post request <Couldn't resolve host name>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============


I thought the "/ocsreports" - suffix could be a problem so i improvised a litle ;)

I created a symbolic link inside the VHosts root directory wich points to itself, so it should work even if it's hardcoded somewhere. And i modified the ini file of the agent itself so that it connects to the "ocsreports" suffix.

And yes the agent log looks better, but it still wont work:


==============================================================================
Starting OCS Inventory NG Agent on Tuesday, May 12, 2020 11:12:38.
AGENT => Running OCS Inventory NG Agent Version 2.6.0.0
AGENT => Using OCS Inventory NG FrameWork Version 2.6.0.0
AGENT => Loading plug-in(s)
    DLL PLUGIN => Searching for Plug-in DLL(s) in folder <C:\Program Files\OCS Inventory Agent\plugins>
    DLL PLUGIN => 0 DLL Plug-in(s) successfully loaded on 0 DLL(s) found
AGENT => Using network connection with Communication Server
    COM PROVIDER => Loading Communication Provider <C:\Program Files\OCS Inventory Agent\ComHTTP.dll>
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.6.0.0>
AGENT => Sending Prolog
    DID_CHECK => Read DeviceID <w10x64-2020-03-17-11-02-00> and MACs <D2:D5:53:18:A1:6C> in file <ocsinventory.dat>
    COM SERVER => Initializing cURL library for sendRequest
    COM SERVER => Using cURL without server authentication
    COM SERVER => Disabling cURL proxy support
    COM SERVER => Disabling cURL SSL server validation support
    COM SERVER => Sending HTTP Post request to URL <http://ocs.localdomain.tld/ocsreports>
    COM SERVER => HTTP Post response received <HTTP Status Code #200>
    COM SERVER => Cleaning cURL library
================= TRACE START ===============

================= TRACE STOP ===============


Here are some more informations:

ocsinventory.ini


[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=2
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=
http://ocs.localdomain.tld

SSL=0
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=0
Proxy=
ProxyPort=0
ProxyAuthRequired=0
ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=10
OLD_PROLOG_FREQ=10
TTO_WAIT=33960
INVENTORY_ON_STARTUP=0


Virtualhost


root@debian:~# ls -lah /opt/ocs.localdomain.tld/
insgesamt 16K
drwxr-xr-x  3 www-data www-data 4,0K Mai 11 15:02 .
drwxr-xr-x  7 www-data www-data 4,0K Mai 11 14:47 ..
drwxr-xr-x 18 www-data www-data 4,0K Mai 11 17:41 ocsreports
root@debian:~# ls -lah /opt/ocs.localdomain.tld/ocsreports/
insgesamt 568K
drwxr-xr-x 18 www-data www-data 4,0K Mai 11 17:41 .
drwxr-xr-x  3 www-data www-data 4,0K Mai 11 15:02 ..
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 ajax
-rwxr-xr-x  1 root     www-data 1,2K Mai 11 14:48 ajax.php
drwxr-xr-x  6 root     www-data 4,0K Mai 11 14:48 backend
-rwxr-xr-x  1 root     www-data  26K Mai 11 14:48 Changes
-rwxr-xr-x  1 root     www-data  430 Mai 11 14:48 composer.json
drwxr-xr-x  4 www-data www-data 4,0K Mai 11 14:48 config
-rwxr-xr-x  1 root     www-data 1,1K Mai 11 14:48 Contributors
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 crontab
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 css
-rw-rw-r--  1 root     www-data  368 Mai 11 16:19 dbconfig.inc.php
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 extensions
-rwxr-xr-x  1 root     www-data 362K Mai 11 14:48 favicon.ico
drwxr-xr-x  3 root     www-data 4,0K Mai 11 14:48 files
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 image
-rwxr-xr-x  1 root     www-data 1,7K Mai 11 14:48 index.php
-rwxr-xr-x  1 root     www-data  21K Mai 11 14:48 ipdiscover-util.pl
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 js
drwxr-xr-x  9 root     www-data 4,0K Mai 11 14:48 libraries
-rwxr-xr-x  1 root     www-data  18K Mai 11 14:48 LICENSE
lrwxrwxrwx  1 root     root        1 Mai 11 17:41 ocsreports -> .
drwxr-xr-x  7 root     www-data 4,0K Mai 11 14:48 plugins
-rwxr-xr-x  1 root     www-data 4,3K Mai 11 14:48 README.md
drwxr-xr-x 24 root     www-data 4,0K Mai 11 14:48 require
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 templates
drwxr-xr-x  3 root     www-data 4,0K Mai 11 14:48 themes
drwxr-xr-x  2 root     www-data 4,0K Mai 11 14:48 tools
-rwxr-xr-x  1 root     www-data 4,8K Mai 11 14:48 update.php
-rwxr-xr-x  1 root     www-data 5,0K Mai 11 14:48 var.php
drwxr-xr-x  6 root     www-data 4,0K Mai 11 14:48 vendor


I don't know why my agents cant connect to my server, anyone got an idea which logfile i could check to solve this issue?

----

n811

closed with the note: Problem solved
in OCS Inventory NG agent for Windows by (190 points)
closed by

2 Answers

+1 vote

Hi,

This definition is not correct => Server=http://ocs.localdomain.tld

You must have this => Server=http://ocs.localdomain.tld/ocsinventory on all the clients.

Make the change, save and restart the service, then send an inventory

Regards

Frank

by (88.5k points)
0 votes
Hi Frank,

i fixed it.

I've read through the errors of other people and recognized my error wasnt cuz of the vHost.

It seems like a common issue.

The installer asks for Credentials but didn't wrote it in all files down.

Sometimes it will wrote down the default values.

I checked each directory (etc/apache, /usr, /opt/) for wrong database strings by executing

$ grep -r "ocsweb" <path>

After this i updated the Connections and reinstalled the Agent.

Now it works.

I also used the ur url.

Thanks.
by (190 points)
 
Powered by Question2Answer
...