fusioninventory-for-glpi icon indicating copy to clipboard operation
fusioninventory-for-glpi copied to clipboard

SNMP inventory for computers

Open ddurieux opened this issue 8 years ago • 3 comments


Author Name: Anonymous (Anonymous) Original Redmine Issue: 2166, http://forge.fusioninventory.org/issues/2166 Original Date: 2013-06-18


We have some computers (appliances) running Linux that we are completely forbidden to install any new software (such as FusionInventory agent).

For cases like that, it would be very useful if we can get some information by SNMP netinventory.

We have already the possibility of creating new models for a Computer. Why not use them for getting information by SNMP?

ddurieux avatar Sep 30 '15 17:09 ddurieux


Original Redmine Comment Author Name: Anonymous (Anonymous) Original Date: 2013-07-30T16:21:59Z


Do you have any idea when this feature will be available? Thank you!

ddurieux avatar Sep 30 '15 17:09 ddurieux


Original Redmine Comment Author Name: David Durieux (@ddurieux) Original Date: 2014-06-12T01:08:30Z


Not really, not easy to do

ddurieux avatar Sep 30 '15 17:09 ddurieux

I too am in the need to import some inventory details for linux appliances that expose just a SNMP interface. Via snmpwalk I can collect a lot of info. Some of the appliances expose just IF-MIB, and are correctly parsed by fusioninventory-netinventory. Others expose MIBs like IP-MIB, IP-FORWARD-MIB, TCP-MIB, UDP-MIB, HOST-RESOURCES-MIB, which should provide most hardware information needed for a full inventory.

I'd like to volunteer to add this functionality, but I need guidance on where to start and how to design it. I'm fluent in perl/Net::SNMP, but I'm not familiar with fusioninventory's internal model and the way it communicates with GLPI.

Where would I need to start? It seems that by itself NetInventory already can poll some of this information, but COMPUTER objects are not supported in GLPI with NetInventory - see this: https://forum.glpi-project.org/viewtopic.php?id=282383

[root@Heimdall ~]# fusioninventory-netinventory --host 10.0.5.5 --community snmp-secret --credentials version:2,community:snmp-secret --type COMPUTER --control --debug
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
  <CONTENT>
    <AGENT>
      <AGENTVERSION>2.3.21</AGENTVERSION>
      <START>1</START>
    </AGENT>
    <MODULEVERSION>2.3</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>foo</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>
[debug] creating 1 worker threads
[debug] [thread 1] creation
[debug] [thread 1] scanning 0
[info] Polling 10.0.5.5 with community snmp-secret
[debug] Opening  /usr/share/fusioninventory/sysobject.ids
[debug] full match for sysobjectID .1.3.6.1.4.1.9694.1.5 in database
[debug] [thread 1] termination
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
  <CONTENT>
    <DEVICE>
      <INFO>
        <COMMENTS>Arbor Networks TMS 9.4.0.0  Model: TMS-VSM-10  Serial: 4893959105787672340352</COMMENTS>
        <CONTACT>Unknown</CONTACT>
        <ID>0</ID>
        <LOCATION>MyLocation</LOCATION>
        <MAC>78:ba:f9:99:ff:aa</MAC>
        <MANUFACTURER>Arbor Networks</MANUFACTURER>
        <MODEL>Arbor TMS</MODEL>
        <NAME>myhostname</NAME>
        <TYPE>COMPUTER</TYPE>
        <UPTIME>147 days, 02:34:16.82</UPTIME>
      </INFO>
      <PORTS>
        <PORT>
          <IFDESCR>logical0: Mitigation port, 802.3ad LACP</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>40187180</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>logical0</IFNAME>
          <IFNUMBER>200</IFNUMBER>
          <IFOUTERRORS>6</IFOUTERRORS>
          <IFOUTOCTETS>8717320</IFOUTOCTETS>
          <IFSPEED>80000000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>161</IFTYPE>
          <MAC>78:ba:f9:99:ff:a1</MAC>
        </PORT>
        <PORT>
          <IFDESCR>tmsx0: Mitigation port, Ethernet, 10000 Mbps</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>2215074931</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>tmsx0</IFNAME>
          <IFNUMBER>301</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>1178737277</IFOUTOCTETS>
          <IFSPEED>10000000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>6</IFTYPE>
          <MAC>78:ba:f9:99:ff:a2</MAC>
        </PORT>
        <PORT>
          <IFDESCR>tmsx1: Mitigation port, Ethernet, 10000 Mbps</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>3325370754</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>tmsx1</IFNAME>
          <IFNUMBER>302</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>4085175898</IFOUTOCTETS>
          <IFSPEED>10000000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>6</IFTYPE>
          <MAC>78:ba:f9:99:ff:a3</MAC>
        </PORT>
        <PORT>
          <IFDESCR>mgt0: Management port, 10000 Mbps</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>1454075508</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>mgt0</IFNAME>
          <IFNUMBER>500</IFNUMBER>
          <IFOUTERRORS>0</IFOUTERRORS>
          <IFOUTOCTETS>1941771456</IFOUTOCTETS>
          <IFSPEED>10000000000</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>1</IFTYPE>
          <MAC>78:ba:f9:99:ff:a4</MAC>
        </PORT>
        <PORT>
          <IFALIAS>traffic to XXX</IFALIAS>
          <IFDESCR>logical0.100: Mitigation port, 802.1q VLAN</IFDESCR>
          <IFINERRORS>0</IFINERRORS>
          <IFINOCTETS>4220376096</IFINOCTETS>
          <IFINTERNALSTATUS>1</IFINTERNALSTATUS>
          <IFLASTCHANGE>0.00 seconds</IFLASTCHANGE>
          <IFMTU>1500</IFMTU>
          <IFNAME>logical0.100</IFNAME>
          <IFNUMBER>1000</IFNUMBER>
          <IFOUTERRORS>2</IFOUTERRORS>
          <IFOUTOCTETS>27173568</IFOUTOCTETS>
          <IFSPEED>0</IFSPEED>
          <IFSTATUS>1</IFSTATUS>
          <IFTYPE>135</IFTYPE>
          <MAC>78:ba:f9:99:ff:a5</MAC>
        </PORT>
      </PORTS>
    </DEVICE>
    <MODULEVERSION>2.3</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>foo</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
  <CONTENT>
    <AGENT>
      <END>1</END>
    </AGENT>
    <MODULEVERSION>2.3</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>foo</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>
[debug] cleaning 1 worker threads
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
  <CONTENT>
    <AGENT>
      <END>1</END>
    </AGENT>
    <MODULEVERSION>2.3</MODULEVERSION>
    <PROCESSNUMBER>1</PROCESSNUMBER>
  </CONTENT>
  <DEVICEID>foo</DEVICEID>
  <QUERY>SNMPQUERY</QUERY>
</REQUEST>

Thanks!

mad-ady avatar Nov 16 '21 09:11 mad-ady