OCSInventory-NG / OCSInventory-Server

Communication server of OCS Inventory
http://www.ocsinventory-ng.org/
GNU General Public License v2.0
348 stars 139 forks source link

Table 'ocs_db.DEVICE' doesn't exist !!! #420

Closed bud4 closed 1 year ago

bud4 commented 1 year ago

General informations

Operating system : CentOS Stream 8

Server informations

Perl version : perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi Mariadb version : 10.3.28

OCS Inventory informations

Ocs server version : 2.9.2

Problem's description

DBD::mysql::st execute failed: Table 'ocs_db.DEVICE' doesn't exist at /usr/local/share/perl5/Apache/Ocsinventory/Server/Capacities/Snmp/Inventory.pm line 146 Install from OCSNG_UNIX_SERVER-2.9.2.tar.gz

Non snmp inventory data . Agent send data but no data on server Could it depend on the xml sent by the client? Look down ` [Wed Mar 22 12:11:35 2023][debug] sending: <?xml version="1.0" encoding="UTF-8"?>

Imaging Unit 43200 60000 other Maintenance Kit 184000 200000 Black Cartridge 1200 6000 toner Lexmark MS621dn version MSNGM.053.023 kernel 4.11.12-yocto-standard-0db82913aa9eda284d6d18102f00e414 All-N-1 172.30.10.36 78:8c:77:94:90:f1 FARMA-10-36 51c3e5fd1da5218dc5c2e1435a32a4cd Printer `
charleneauger commented 1 year ago

Hi @bud4 ,

Since the release of the SNMP Scan (in version 2.8.1), you must use a newer Unix Agent (> 2.8.1) for it to work correctly. Like as see on your XML content, this is a old SNMP XML format.

To use SNMP Scan, we recommend to install an agent with a version close to the server.

Best regards, Charlene

bud4 commented 1 year ago

@charleneauger OCS AGENT is > 2.8.1 Name : ocsinventory-agent Version : 2.9.3 Rilascio : 1.el8 Architecture : x86_64 Size : 28 k Sorgente : ocsinventory-agent-2.9.3-1.el8.src.rpm Repository : epel

charleneauger commented 1 year ago

Hi @bud4 ,

OK, can you send me the content of the agent module file ? (/etc/ocsinventory/modules.conf)

Regards, Charlene

bud4 commented 1 year ago

@charleneauger

cat /etc/ocsinventory/modules.conf modules.conf.txt

this list of module will be load by the at run time

to check its syntax do:

perl modules.conf

You must have NO error. Else the content will be ignored

This mechanism goal is to launch agent extension modules

use Ocsinventory::Agent::Modules::Download; use Ocsinventory::Agent::Modules::SnmpScan;

DO NOT REMOVE THE 1;

1;

charleneauger commented 1 year ago

Hi @bud4 ,

Do you have other UNIX agents installed ?

Regards, Charlene

bud4 commented 1 year ago

@charleneauger
Yes but I don't understand why the snmp scan doesn't start on the other agent, yet I configured it. Is there an agent parameter to force snmp scan? Do windows agents allow snmp scanning?

immagine

charleneauger commented 1 year ago

Hi @bud4 ,

Please, disable SNMP scan from agent < 2.8.1 because the old SNMP scan is not compatible with server versions > 2.8. The XML you provided in the issue description matches the old SNMP scan.

The SNMP scan feature requires SSL configuration to work.

Have you configured SNMP from Configuration > SNMP configuration ?

SNMP scan has been removed from Windows agent. Now scans are only performed by UNIX agents.

Best regards, Charlene

bud4 commented 1 year ago

@charleneauger Not linux agents less than 2.9 SSL is active. In fact, the deployment is working. SNMP is on . immagine immagine immagine immagine

bud4 commented 1 year ago

@charleneauger . This is my /var/lib/ocsinventory-agent var_lib_ocsinventory-agent.tar.zip

This is the log of ocsagent : <RESPONSE>NO_ACCOUNT_UPDATE</RESPONSE> </REPLY> '; [Mon Apr 3 13:12:17 2023][debug] =END=SERVER RET====== [Mon Apr 3 13:12:17 2023][debug] Calling handlers :end_handler' [Mon Apr 3 13:12:17 2023][debug] [download] Calling download_end_handler [Mon Apr 3 13:12:17 2023][debug] [snmpscan] Calling snmp_end_handler [Mon Apr 3 13:12:17 2023][info] [download] Beginning work. I am 4115059. [Mon Apr 3 13:12:17 2023][info] [download] No more package to download. [Mon Apr 3 13:12:17 2023][debug] [download] End of work...

`

charleneauger commented 1 year ago

@bud4 , Are these following log lines present (they are at the beginning of the aget log file) ?

[Mon Apr 3 14:07:16 2023][debug] [snmpscan] Calling snmp_start_handler
[Mon Apr 3 14:07:16 2023][debug] - Net::SNMP loaded
bud4 commented 1 year ago

yes. lines are present. @charleneauger EDIT: Now I have this error could not parse 172.30.18.0/24 172.30.81.00/24 172.30.81.0/24 172.30.76.0/24 at /usr/local/share/perl5/Ocsinventory/Agent/Modules/SnmpScan.pm line 372.

Is it possible to force the SNMP scan or does the server decide how often to launch it? Log file: ocsinventory.zip

charleneauger commented 1 year ago

@bud4, if you want to scan multiple networks, you should set the SNMP_NETWORK like this 172.30.18.0/24, 172.30.81.0/24, 172.30.76.0/24.

If SNMP scanning is enabled on a machine, it runs on every inventory. An Agent must be Ipdiscover elected (or forced manually) to be able to make SNMP scan.

bud4 commented 1 year ago

Tanks

charleneauger commented 1 year ago

@bud4 , can i close this issue ? :)

bud4 commented 1 year ago

@charleneauger . Yes ! Tanks a lot.