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.

Change of a clients hostname - OCS creates a new object

Hello Guys,

so yesterday i installed a OCS 2.1.2 server on a Debian 6 Machine.

Seems to working fine. Just 1 problem that i couldn't solve since now.

 

If a Client changes its hostname, OCS is creating a new object on next sync.

As i can See in the database, the primary keys are ID and DEVICEID and the name is a MUL.

is there a workaround to let OCS look up if the device is already existing in the database by comparing the Serial Number or anything equal?

Greets and thanks for any hint
in OCS Inventory NG server for Unix by (260 points)

5 Answers

+1 vote
Look in the config menu for the value of AUTO_DUPLICATE_LVL.
by (22k points)
ok so i checked this option

hostname

Serial

and macadress

are checked.

 

if i uncheck Hostname and macadress it will only compare the serial and rewrite the changes ?
0 votes
i unchecked the hostname checkbox.

When i uncheck it the agent doesn't sync because it see that there is a device with the same serial, so to prevent dublicates it stops the sync.

 

What i try to do is:

When someone change his Hostname on his computer and the agent start a sync, it should compare if a computer with this serial already exists in the database, and if yes, it should change the Hostname of the actual existing device.

is something like this possible?
by (260 points)
+1 vote
It is probably not 'stopping the sync' to prevent duplicates, it is stopping because it is not time for that device to send its inventory again.   It should do what you want when it reaches the time to send.   If you already have duplicates from before you changed the setting you can go to the 'duplicates' section in the web interface and select pairs to merge.
by (1.1k points)
okay, i will uncheck the hostname box and wait a day until it sync again.

 

Thanks for your reply!
0 votes
so i tested this now.

 

for some devices it is working, some devices having the following error in the logfile:

 

[Mon Jan 19 16:16:43 2015][error] Cannot establish communication : 500 Internal Server Error

 

some advices?
by (260 points)
0 votes
ok after is searched a little bit i found the following

 

apache error log says:

[client 10.10.22.42] Can't call method "do" on an undefined value at /usr/local/share/perl/5.10.1/Apache/Ocsinventory/Server/System.pm line 177.\n

 

the line 177 in the above file is this:

$dbh->do("SET sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");

 

i cannot find the error.

libdbi-perl  and libdbd-mysql-perl are the newest versions.

someone knows what to do?
by (260 points)
 
Powered by Question2Answer
...