Development
This is a work in progress to document NeDi's inner workings. It will hopefully soon provide enough information to easily integrate contributions and the likes…
Introduction
NeDi persists of a series of perl scripts (some main programs and shared libraries) on the discovery part and a similar constellation of PHP scripts on the GUI side. In addition it reads or writes a series of text files:
Discovery/Backend
Structure
Main Files
| moni.pl | Daemon | Polls uptimes. Saves states in monitoring table and notifies as configured. |
|---|---|---|
| nedi.pl | Cronjob | Actual discovery |
| syslog.pl | Daemon | Listens on prort 514 for syslog messages stores them and notifies as configured. |
| trap.pl | snmptrapd handler | Stores traps in the messages table. No further development in favour of syslog.pl |
Includes
Each function now contains a header describing the expected arguments, which globabl variables are being modified and what it returns.
| libcli-netssh.pl | CLI functions based on Net::Telnet(::Cisco only required for cat1900 support on –more– prompt, which will be dropped after NeDi 1.0!) and Net::SSH. |
|---|---|
| libdb-msq.pl | DB backend and query generation for MySQL. Could be rewritten for any other way to store and retreive data. |
| libmon.pl | Notifications |
| libsnmp.pl | SNMP and .def file handling |
| libweb.pl | Fetch info through Web interfaces of devices (basically phones). |
| libmisc.pl | All other stuff! |
| oui.txt | MAC address vendors |
| iab.txt | MAC address sub-vendors |
| wlan.txt | 1st 4 bytes of AP MAC addresses collected across Switzerland. This list will be used in Reports-Wlan. |
GUI/Frontend
Structure
Main Files
If you wish to create you own module, have a look at Topology-Table.php to get the idea of how mine are built. Devices-Modules.php is the simplest one to reveal list based functions like SQL query generation and handling or how the actual table and column headers are created.
Includes
| Devsend.pl | Helper script for using libcli-netssh.pl in Devices-Write.php. |
|---|---|
| browsedev.php | Popup for selecting device icon in Other-Defgen.php |
| drawrrd.php | Returns an RRD graph in PNG format. |
| footer.php | Just a simple footer |
| graph.php | Only added for Other-Plot.php, when I was experimenting. |
| header.php | Group assignment and according Menu generation. Theme, Language and html processing. |
| libdev.php | Device related functions |
| libgraph.php | RRD graphing |
| libmon.php | Monitoring Frontend |
| libmsq.php | DB functions that go with libdb-msq.pl |
| libnod.php | Node related code |
| libmisc.php | All other functions |
| snmpget.php | snmpget GUI for Other-Defgen.php |
| snmpwalk.php | snmpwalk GUI for Other-Defgen.php |
| cal.js | Popup calendar for certain List based modules |
| JSCookMenu.js | This and the ThemeN folder belong to the menu system. |
| alarmX.mp3 | Genuine PSI alarms (they where only testing!) |
| enter2.mp3 | A (warning) sound I've created |



