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.

SNMP Inventory shows "No data available in table"

  • OS Name : Linux x86_64
  • Version : 5.3.18-lp152.72-default
  • RAM installed : 3892 MB
  • Free RAM : 3082 MB
  • Distribution : openSUSE Leap 15.2
  • PHP Version : 7.4.6
  • Web Server : Apache
  • Database Server : MariaDB package version 10.4.17-MariaDB
  • Version OCSReports: 2.8.1
  • Agent Version: 2.8.1
  • Agent and Server installed from source

Problem: Inventory --> SNMP = "No data available in table"

Expected result: OCS would scan a host with snmp enabled (192.168.209.134) and add it to the Inventory --> SNMP

My setup has two hosts:

  • openSuse with OCS Server installed
  • ubuntu with snmp enabled
  • Both in the 192.168.209.0/24 network

From command line on the openSUSE server side is possible to view the snmp info from ubuntu:

snmpwalk -v2c -c public 192.168.209.134 1.3.6.1.2.1.1.5

SNMPv2-MIB::sysName.0 = STRING: ubuntu-testes

OCS server is setup to scan snmp like this:

  • Configuration --> General
    • --> SNMP
      • SNMP Enable/Disable the snmp service: ON
    • --> Ipdiscover: ON
  • Manage --> Network Scan
    • SNMP communities --> 
      • Version: 2c
      • Name: public 
  • Configuration --> SNMP
    • --> Create type:
      • Name: host
      • OID Value: 1.3.6.1.2.1.1.5
      • Value: sysName
    • --> Create label:
      • Name: name
    • --> Type configuration
      • Type: host
      • Label: name
      • OID: 1.3.6.1.2.1.1.5
      • Use for reconciliation: yes
    • --> Add MIB File: not configured
  • All computers --> Select localhost (that is the current openSuse ocs server)
    • --> Configuration --> Edit --> Netowrks scans
      • Ipdiscover: 192.168.209.0
      • Snmp_Switch: ON
      • Snmp_Networks 192.168.209.0/24

Server Agent config:

tag=ocs-server

debug=1

logfile=/var/log/ocs-agent.log

server=https://192.168.209.136/ocsinventory

snmpretry=2

snmp=1

nosoftware=0

basevardir=/var/lib/ocsinventory-agent

snmptimeout=3

ca=/etc/ocsinventory-agent/cacert.pem

The server is accessible via https, no cert erros on the ocs agent log

Quering DB show nothing on the snmp table (snmp_host because of the created type host)

MariaDB [ocsweb]> SELECT * FROM snmp_host;

Empty set (0.000 sec)

Relevant log from ocs agent (middle part that shows the inventory was removed):

[Fri Apr 23 13:58:16 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1

[Fri Apr 23 13:58:16 2021][debug] Log system initialised (File)

[Fri Apr 23 13:58:16 2021][debug] --scan-homedirs missing. Don't scan user directories

[Fri Apr 23 13:58:16 2021][debug] Accountinfo file: /var/lib/ocsinventory-agent/https:__192.168.209.136_ocsinventory/ocsinv.adm

[Fri Apr 23 13:58:16 2021][debug] OCS Agent initialised

[Fri Apr 23 13:58:16 2021][debug] Turns hooks on for /etc/ocsinventory-agent/modules.conf

[Fri Apr 23 13:58:16 2021][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.8.1

[Fri Apr 23 13:58:16 2021][debug] Log system initialised (File)

[Fri Apr 23 13:58:16 2021][debug] Calling handlers : `start_handler'

[Fri Apr 23 13:58:16 2021][debug] [snmpscan] Calling snmp_start_handler

[Fri Apr 23 13:58:16 2021][debug]  - Net::SNMP loaded

[Fri Apr 23 13:58:16 2021][debug] Compress::Zlib is available.

[Fri Apr 23 13:58:16 2021][debug] Calling handlers : `prolog_writer'

[Fri Apr 23 13:58:16 2021][debug] sending XML

[Fri Apr 23 13:58:16 2021][debug] sending: <?xml version="1.0" encoding="UTF-8"?>

<REQUEST>

  <DEVICEID>localhost-2021-04-22-16-11-02</DEVICEID>

  <QUERY>PROLOG</QUERY>

</REQUEST>

[Fri Apr 23 13:58:16 2021][debug] =BEGIN=SERVER RET======

[Fri Apr 23 13:58:16 2021][debug] $VAR1 = '<?xml version=\'1.0\' encoding=\'UTF-8\'?>

<REPLY>

  <INVENTORY_ON_STARTUP>1</INVENTORY_ON_STARTUP>

  <OPTION>

    <PARAM IPDISC_LAT="100">192.168.209.0</PARAM>

    <NAME>IPDISCOVER</NAME>

  </OPTION>

  <OPTION>

    <PARAM ON="0" TYPE="CONF" FRAG_LATENCY="10" PERIOD_LENGTH="10" PERIOD_LATENCY="1" EXECUTION_TIMEOUT="120" TIMEOUT="30" CYCLE_LATENCY="60" />

    <NAME>DOWNLOAD</NAME>

  </OPTION>

  <OPTION>

    <PARAM TYPE="NETWORK" SUBNET="192.168.209.0/24" />

    <PARAM CONDITION_VALUE="sysName" OID="1.3.6.1.2.1.1.5" TYPE="SNMP_TYPE" CONDITION_OID="1.3.6.1.2.1.1.5" LABEL_NAME="name" TYPE_NAME="host" TABLE_TYPE_NAME="snmp_host" />

    <PARAM NAME="public" TYPE="COMMUNITY" AUTHKEY="" USERNAME="" AUTHPASSWD="" VERSION="2c" />

    <NAME>SNMP</NAME>

  </OPTION>

  <PROLOG_FREQ>24</PROLOG_FREQ>

  <RESPONSE>SEND</RESPONSE>

</REPLY>

';

[Fri Apr 23 13:58:16 2021][debug] =END=SERVER RET======

[Fri Apr 23 13:58:16 2021][debug] PROLOG_FREQ has not changed since last process

[Fri Apr 23 13:58:16 2021][debug] Calling handlers : `prolog_reader'

[Fri Apr 23 13:58:16 2021][debug] [snmpscan] Calling snmp_prolog_reader

[Fri Apr 23 13:58:17 2021][debug] Ocsinventory::Agent::Backend::IpDiscover::IpDiscover ignored

[Fri Apr 23 13:58:17 2021][debug]  - nmap found

[Fri Apr 23 13:58:17 2021][debug] Ocsinventory::Agent::Backend::IpDiscover::Nmap ignored

[Fri Apr 23 13:58:17 2021][debug] Ocsinventory::Agent::Backend::OS::AIX ignored

[Fri Apr 23 13:58:17 2021][debug] Ocsinventory::Agent::Backend::OS::BSD ignored

[Fri Apr 23 13:58:17 2021][debug]  - dmidecode found

[Fri Apr 23 13:58:17 2021][debug]  - dmidecode found

[Fri Apr 23 13:58:17 2021][debug]  - Sys::Hostname loaded

[Fri Apr 23 13:58:17 2021][debug]  - ipmitool found

[Fri Apr 23 13:58:17 2021][debug]  - Net::IP qw(:PROC) loaded

[Fri Apr 23 13:58:17 2021][debug] Ocsinventory::Agent::Backend::OS::Generic::Ipmi ignored

[Fri Apr 23 13:58:17 2021][debug]  - lspci found

[Fri Apr 23 13:58:17 2021][debug]  - lspci found

[Fri Apr 23 13:58:17 2021][debug]  - lsusb found

[Fri Apr 23 13:58:17 2021][debug]  - updatedb found

<<<< removed >>>>>>

[Fri Apr 23 13:58:20 2021][debug] =END=SERVER RET======

[Fri Apr 23 13:58:20 2021][debug] Calling handlers : `end_handler'

[Fri Apr 23 13:58:20 2021][debug] [snmpscan] Calling snmp_end_handler

[Fri Apr 23 13:58:20 2021][debug] [snmpscan] Snmp: Scanning network

[Fri Apr 23 13:58:20 2021][debug]  - Net::Netmask loaded

[Fri Apr 23 13:58:20 2021][debug]  - nmap found

[Fri Apr 23 13:58:20 2021][debug]  - Net::Ping loaded

[Fri Apr 23 13:58:20 2021][debug] [snmpscan] Scanning 192.168.209.0/24 with ping

[Fri Apr 23 13:58:20 2021][debug] [snmpscan] Found 192.168.209.1

[Fri Apr 23 13:58:20 2021][debug] [snmpscan] Found 192.168.209.2

[Fri Apr 23 14:00:31 2021][debug] [snmpscan] Found 192.168.209.134

[Fri Apr 23 14:00:32 2021][debug] [snmpscan] Found 192.168.209.136

[Fri Apr 23 14:02:30 2021][debug] [snmpscan] Snmp: Ending Scanning network

[Fri Apr 23 14:02:30 2021][debug] [snmpscan] Scanning 192.168.209.1 device

[Fri Apr 23 14:02:30 2021][debug] [snmpscan] Scanning 192.168.209.2 device

[Fri Apr 23 14:02:39 2021][debug] [snmpscan] Scanning 192.168.209.134 device

[Fri Apr 23 14:02:39 2021][debug] [snmpscan] Scanning 192.168.209.136 device

[Fri Apr 23 14:02:48 2021][info] [snmpscan] No more SNMP device to scan

[Fri Apr 23 14:02:48 2021][debug] sending XML

[Fri Apr 23 14:02:48 2021][debug] sending: <?xml version="1.0" encoding="UTF-8"?>

<REQUEST>

  <DEVICEID>localhost-2021-04-22-16-11-02</DEVICEID>

  <QUERY>SNMP</QUERY>

</REQUEST>

[Fri Apr 23 14:02:48 2021][debug] [snmpscan] End snmp_end_handler :)

in OCS Inventory NG server for Unix by (450 points)
edited by

3 Answers

+1 vote
 
Best answer
I solved about one hour agoo :-D

I update my Linux packets installation (but was not very old, the installation is make about 2/3 months agoo) and add in PATH /usr/sbin

Is a very miracle, I show the device in inventory --> SNMP

Now the problem is that there isn't static OID for IP address, OCS see the device but and value that I put in configuration, but not other information like ip address.

Thanks
by (550 points)
selected by
+2 votes
Hi, I'm the same issue.

I found the device, the SNMP query starts, the xml is sendig... but no data in inventory --> snmp.

I'm very frustrated because there isn't clear instructions, this is strange, and logs not show what happen when the xml was sent at server. No error log, in apache, no error log in mysql... WHERE IS MY XML??? :-D

Have you solved?

Thanks
by (550 points)
+1 vote

Not solved yet.

This SNMP bug is still there, I will create a ticket on the project page on git hub if my organization decides to use OCS to do inventory

They are looking to do inventory with Zabbix since they want to use the SNMP functionality that is not working on OCS ( I’m against it, but…)

If you really need this functionality please open a detailed ticket on GitHub because looks like developers don’t use this forum

https://github.com/OCSInventory-NG/OCSInventory-Server/issues

by (450 points)
 
Powered by Question2Answer
...