hubblo-org / cabestan

Gather and normalize ICT inventory data from multiple sources, to enable automation of ICT carbon and environmental impacts (LCA-inspired) assessments.
Apache License 2.0
14 stars 2 forks source link

Observium scanner #11

Open da-ekchajzer opened 2 years ago

da-ekchajzer commented 2 years ago

Problem

I want to use cabestan to gather my assets list from Observium

Rest API

doc : https://docs.observium.org/api/

  1. list all devices : GET {base_url}/api/v0/devices/
  2. list all info on a device : GET {base_url}/api/v0/devices/1/

result :

{
  "status": "ok",
  "count": 2,
  "devices": {
    "277": {
      "device_id": "277",
      "hostname": "router-1.company.com",
      "sysObjectID": ".1.3.6.1.4.1.9.1.620",
      "sysDescr": "Cisco IOS Software, 1841 Software (C1841-IPBASE-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright 
(c) 1986-2010 by Cisco Systems, Inc.\r\nCompiled Thu 28-Oct-10 15:40 by prod_rel_team",
      "version": "15.0(1)M4",
      "hardware": "CISCO1841",
      "features": "IPBASE",
      "os": "ios",
      ...
      <most device data removed for brevity>
    },
    "278": {
      "device_id": "278",
      "hostname": "router-b.company.com", }
      "sysObjectID": ".1.3.6.1.4.1.9.1.620",
      "sysDescr": "Cisco IOS Software, 1841 Software (C1841-IPBASE-M), Version 15.0(1)M4, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright 
(c) 1986-2010 by Cisco Systems, Inc.\r\nCompiled Thu 28-Oct-10 15:40 by prod_rel_team",
      "version": "15.0(1)M4",
      "hardware": "CISCO1841",
      "features": "IPBASE",
      "os": "ios",
      ...
      <most device data removed for brevity>
    }
  }
}

Auto-discovery

doc : https://docs.observium.org/autodiscovery/

Observium provide an auto-discovery method which uses :

  1. "SNMP to gather information about a device. This information allows Observium to discover all the internal sensors and interfaces of this device."
  2. "Observium finds all the neighbors of this device by using protocols such as CDP, LLDP, FDP, or EDP, and gathering neighbor information from routing protocols such as OSPF."

Auto-discovery needs modifications in the configuration files of the Observium instance.

Observium Auto-discovery shouldn't be configured from cabestan :

  1. We can document the process for user using the Observium scanner
  2. We can be inspired by the existing auto-discovery feature for or own SNMP scanner #7