Skip to main content
Released

Autodiscovery mapper with OID

Related products:Infra Monitoring - DiscoveryInfra Monitoring - Connectors
  • May 29, 2022
  • 6 replies
  • 92 views

coco163
Forum|alt.badge.img+11

Hi team,

Considering that some hardware are still not in the plugin packs, i created host/service templates using generic snmp plugin.

However, for the autodiscovery, we cannot use a mapper based on a specific OID (i.e hardware, enterprise, model...etc).

That would be very nice to have this possibility added in a near future.

 

Regards.

6 replies

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • June 2, 2022
Updated idea statusNewDiscussion ongoing

fgbetokpanou
Centreonian
Forum|alt.badge.img+11
  • Centreonian
  • June 2, 2022

Hi @coco163, Thank you for your idea proposal. I would invite you to reformulate it according to the guidelines you can find here and write it in english. This would help the product manager team to better evaluate your proposal. Thanks for your understanding 😊


sims24
Forum|alt.badge.img+19
  • Ranger ***
  • June 29, 2022

Hi @coco163 

 

Thanks for posting and the feedback. 


As Host discovery module requires fixed attributes, we have to keep a global and always defined key in the discovery raw result. 

 

That being said, we could imagine add a new ‘extra_oids’ attribute, working similarly to tags attributes existing in cloud discovery providers. Then, the creation of mappers leveraging this attributes will be on your side depending of the extra OID(s) value(s) you want to add to your discovery. 

 

Here an example of how the command’s parameters might looks like:

perl centreon_plugins.pl --plugin=os::linux::local::plugin --mode=discovery-snmp --subnet='172.16.4.125/32' --snmp-community='public' --snmp-version=2c --prettify --extra-oids='.1.3.6.1.2.1.25.1.4.0,1.2.3.4,.1.3.6.1.2.1.1.1.0'

 

Resulting in a JSON like: 

{
   "end_time" : 1656506684,
   "start_time" : 1656506684,
   "duration" : 0,
   "discovered_items" : 1,
   "results" : [
      {
         "snmp_version" : "2c",
         "ip" : "172.16.4.125",
         "hostname" : "centreon-central-vm",
         "snmp_community" : "public",
         "desc" : "Linux centreon-central-vm 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64",
         "type" : "linux",
         "snmp_port" : 161,
         "extra_oids" : {
            ".1.3.6.1.2.1.25.1.4.0" : "BOOT_IMAGE=/vmlinuz-3.10.0-1160.62.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv",
            "1.2.3.4" : "unknown",
            ".1.3.6.1.2.1.1.1.0" : "Linux centreon-central-vm 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64"
         }
      }
   ]
}


Note that because of the extra_oids attributes structure, it will only work if you use Centreon 21.10 or above. 

 

Would that work for you? 

 

Thanks


coco163
Forum|alt.badge.img+11
  • Author
  • Steward ***
  • July 28, 2022

Noted, i will test that


Forum|alt.badge.img+5
  • Centreonian
  • August 11, 2022
Discussion ongoingIn Backlog

sims24
Forum|alt.badge.img+19
  • Ranger ***
  • September 6, 2022

It has been pushed to master and will be available mid-september. 

 

Final implementation allows to add such option to your discovery through the step 3 and ‘Extra options’ field of the discovery job configuration: 

--extra-oids=.1.3.6.1.2.1.1.6.0 

or, if you prefer to manipulate label or need multiple OIDs

--extra-oids=sysowner=.1.3.6.1.2.1.1.4.0,sysloc=.1.3.6.1.2.1.1.5.0

 

The result is an array of hashes you can easily manipulate through mappers: 

         "extra_oids" : {
"sysloc" : "datacenter-rack-0",
"sysowner" : "awesome admin"
},