Expand

Support for Unknown Devices

Virtually any SNMP device can be managed by NeDi and I don’t just mean reading some default MIBs. All you need is a .def file which resides in the sysobj folder. In addition CLI support can be added by following the steps in the tutorial or even editing libcli-iopty.pm, but that’s a bit trickier…

Defining Devices

If an unknown device is discovered, you can create a definition file and assign an icon to it, with that it can be properly supported within NeDi.

The easiest way is through Defgen, which can be invoked by clicking on the sysobj value in Devices-List or the triangle icon in Devices-Status. Consult the help (life-saver icon on top) or have a look at the tutorial to learn how to use Defgen.

Device Icons

In order to provide some sort of consistency while not limiting expanding device support, I’ve come up with this scheme, which should cover most of the device types out there. A few exceptions exist, mainly concerning printers and supervisor(s). Use the browser in Defgen to select the icon according to the following scheme…

Colors

The color indicates the device health (starting wtih NeDi 2.0)

StateColor
GoodGreen
(New) Alert(Red) Orange
Acknowledged Alert, InformalBlue
UnknownGray

Icons

TypeSubtypeShadeIcon Name
Cloud (dummy device)clm
Workgroup Switch (L2)~12 Portpales2s
Workgroup Switch (L2)~24 Portnormals2m
Workgroup Switch (L2)~48 Portdarks2l
Workgroup Switch (L3)~12 Portpales3s
Workgroup Switch (L3)~24 Portnormals3m
Workgroup Switch (L3)~48 Portdarks3l
Modular Switchsmallpalesms
Modular Switchmediumnormalsmm
Modular Switchlargedarksml
Switch Stackskm
Fabric Switchsfm
Routersmallrts
Routermediumrtm
Routerlargertl
Firewallfwm
Appliance/Computercpm
Load Balancerlbm
IP Phonephm
Storagestm
Wlan Access Pointwam
Wlan Bridgewbm
Wlan Controllerwcm
Sensorsem
Video Systemvcm

API

NeDi’s API allows reading data from a table. You can use basic-auth with GET request or submit credentials as well with POST:

GET or POST options:

  • t table (prepend with COUNT to count values instead listing them)
  • q query in the form of column (= LIKE < > | &) string
  • o order column (prepend with – for descending)
  • l limit number[,offset]
  • m mode csv also returns load and available memory in the 1st row (default is json)

POST only:

  • u user
  • p password

It uses query.php, which can be presented intuitively with a rewrite rule:

rewrite rule for nginx

location /api {
rewrite ^/api/(\w*)$ /query.php?t=$1&q=$args last;
}

nedi-postman

I recommend using RESTClient for Firefox or the Chrome extension “postman” for testing:

As you can see, the rewrite rule assigns the path after API/ to the table (t) variable and the optional query to q…

nedi-postman2

Without rewrite rule, the API can be used like this:

Queries can be worked out with regular GUI modules. As admin, click on the ladybug in the top right corner to enter debug mode. You can click on a query to examine it further in System-Export. This export module is helpful to explore the database structure as well.

Due to the fact that queries can circumvent NeDi’s tenant filters, the user cannot have a “Filter Devices” set in User-Management.