1.0.0 • Published 5 years ago

rm_discovery v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Discovery

Discovery is a tool that collects the information about devices within a network, sanitizes and structures it, and makes it available from a centralized location (RM). The data will stay up-to-date as the Discovery tool will regularly scan the network and look for the changes made to those devices. It can locate new devices connected to the network as well as identify the disabled/removed devices. Moreover, it can also recognize missing or additions of internal hardware (ex: cards and ports).

Use Case

Inventory

Discovery addresses the tedious problem of manually performing the Audits by automating the searching process. Instead of physically digging through the lab/screenshoots, Discovery takes a Serial Number as input, which is searched for in the Discovery created DB, and returns the location of the match.
This feature is available through the current RM GUI. Using the search bar on the top of the dashboard, a user can query all the assets.

Format for query

@propertyName=propertyValue @propertyName2=propertyValue2

Using the above format, a serial number can queried. For ex: @Serial Number=001289379123-6322

RM assets

RM is a resource tracking and reservation tool that requires users to manually enter the data; however, Discovery scans for the same data automatically, thus could be an important integration for RM. Letting Discovery handle the RM data has multiple benefits:

  • Reduce the chances of Human Error in the data entered
  • Contain 3x more data about each device than the current version as well as 2x the number of devices
  • Improve the format and structure of the data
  • Provide Updated information due to it's daily scanning feature

How it works?

  • Begins by looping through each IP in the subnet
  • If the IP is not discovered from previous searches (meaning IP doesn't exist in DB), then it attempts to discover the device at that node
    • According to the current progress, Discovery, firstly, assumes the device is a NTO and attempts to connect to the NTO API using that IP
    • If the connection is successful, then it pulls data from several APIs, sanitizes the information, put's it in a presentable format, and pushes it to the DB.
    • However, if the connection is unsuccessful, then Discovery assumes the device is a TG and attempts to connect it through TCL
    • Upon successful connection, it executes a series of command to get all the information required, puts it in a presentable format, and pushes it to the DB.
    • If connection is rejected, then Discovery skips the IP and performs no actions.
  • If IP is already discovered prior, then Discovery attempts to update the information
    • Instead of doing a trial and error to identify the type of the machine, Update process already knows that
    • Disocvery gets a copy of the device with the current configuration, then performs a side by side comparison with the one from DB, and writes the changes to DB.

How to use it?

# go the Discovery directory
cd Discovery

# install dependencies
npm install

# run the app
node app.js

Configuration

There are two ways to use the Discovery tool.

  • To perform a complete search of the network and add all the devices found to the DB, following command is used
discovery.discover(db)

discovery is a reference to the DiscoveryManager.js and discovery is method that takes the DB reference and performs the cycle.

  • In order to individually discover devices, following command is used
discovery.init(db)
discovery.test(ip='', write=true)

discovery.init(db) needs to be executed onces before doing testing on individual IPs
discovery.test takes the IP as it's first parameter and a boolean value as second. The boolean value signifies if the data wants to be written to the DB (true-Yes, false-No)

In app.js, subnet='' needs to be set to whatever subnet is being scanned.