8 Commits

Author SHA1 Message Date
Tony Murray
abc6a5b799 PSR-2 Final cleanup (#4247)
refactor: Final PSR2 cleanup
2016-08-28 23:32:55 +01:00
Tony Murray
b8e9b2d917 Implement an autoloader (#4140)
* Implement an autoloader

When cleaning up classes for psr2, things got a bit unwieldy, so I implemented a class autoloader.
I created a PSR-0 compliant LibreNMS directory and moved all classes there that made sense.
Implemented LibreNMS\ClassLoader which supports adding manual class mappings

This reduces the file includes needed and only loads classes when needed.

* Add teh autoloader to graph.php

* Add a small bit of docs
Fix incomplete class in includes/discovery/functions.inc.php
2016-08-21 14:07:14 +01:00
laf
b673432058 Added support for nets-exclude in snmp-scan 2016-08-12 21:39:53 +01:00
Tony Murray
f3fc6f2906 Use Exceptions
Use exceptions for addHost()
Gets rid of silly mixed return and only returns the device_id.  Throwing an exception if we run into any issues.
Slightly modifies api add host output again to include device_id
2016-08-07 12:16:40 -05:00
Tony Murray
66bed276c2 Reconstruct addHost() so it is easier to understand
Update addHost() to return either device_id or a string
modify print_error(), print_message() to allow for $quiet variable
Only call addHost() once in addhost.php, if the snmp version isn't set, addHost will cope
Fix up snmp-scan.php and discovery-protocols.inc.php to detect when a device already exists
change in ip_exists() to make it more readable
2016-08-02 00:31:27 -05:00
f0o
531caf2823 Fix Scrut. Moved ip-check out of transport-loop. 2015-08-01 09:58:56 +00:00
f0o
fef715cde3 Add support for $config['nets'] 2015-08-01 09:35:49 +00:00
f0o
e2d6a99903 Added SNMP-Scanner + Docs 2015-08-01 08:59:35 +00:00