Commit Graph

169 Commits

Author SHA1 Message Date
Tony Murray
9284bc60ff Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
2016-08-28 18:32:58 +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
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
laf
d722bb6943 Update use of max repeaters to save mysql queries 2016-07-30 15:11:29 +01:00
Søren Rosiak
5ca2eab0dc Merge pull request #3823 from laf/device-type-discovery 2016-07-21 22:14:00 +02:00
Neil Lathwood
121781ce9a Merge pull request #3759 from Misch-/master
Always log why discovery fails
2016-07-11 19:02:51 +01:00
laf
0ec980c1cd Moved the device type discovery to before it is needed 2016-07-11 12:33:09 +01:00
laf
33415796bd Re-enable the ability to run a disabled module manually 2016-07-11 12:28:54 +01:00
Carlin Mische
ebe42a023d Changed snmp access failed logging to reflect that host could be unreachable too 2016-07-10 20:34:10 -05:00
Carlin Mische
f90b2aa7ff Fixed using undefined variable in discovery failure logging 2016-07-07 00:01:24 -05:00
Carlin J Mische
bc642dcc39 Fixed style and capitalization on log messages 2016-07-01 09:53:28 -05:00
Carlin J Mische
e596953fe6 Modified discover_new_device() function to always log why discovery of a new host fails 2016-06-30 16:28:54 -05:00
laf
6ba32ebe5c Fix for polling/discovery function issue 2016-06-24 15:32:19 +01:00
laf
5d16cdb20a Fixed errors from scrut/murrant 2016-06-22 19:10:33 +01:00
laf
246664d1f9 Updated module run time to be limited to 5 decimal places 2016-06-21 01:44:50 +01:00
laf
558dfb2344 Pretty up the discovery process output 2016-06-21 00:59:43 +01:00
Tony Murray
b37d0f2e9e Draw graphs for avtech switch state. 2016-06-06 19:17:19 -05:00
Tony Murray
807e3dfe61 Fix avtech switch type sensors 2016-06-06 15:33:41 -05:00
Tony Murray
9393c0e716 Fixes for the Avtech sensor state 2016-06-04 10:09:43 -05:00
Tony Murray
f4cfd61aef Capitalize state descriptions 2016-06-03 21:48:24 -05:00
Tony Murray
b54f449ed8 Add Avtech switch support 2016-06-03 21:44:21 -05:00
Søren Rosiak
edd3d61fc8 Fix typo.. 2016-06-02 18:59:43 +02:00
Paul Heinrichs
499a23e372 Adjusted canopy sensor high/low limits 2016-04-06 08:20:10 -04:00
Paul Heinrichs
a13d148fb1 Added Signal Sensor 2016-03-22 10:37:07 -04:00
Rosiak
f1bb532d30 check_valid_sensors - Correction
#3229
2016-03-12 23:27:21 +01:00
Tony Murray
eb9281ff10 Fixes for Avtech
Trim quotes from description
Correct sensor type
Allow sensor id of 0
Correct indexes for sensors
2016-03-09 12:34:29 -06:00
Tony Murray
13260ce152 Move avtech_add_sensor function to includes/discovery/functions.php
allow type to be specified
else if -> elseif
2016-03-05 08:33:14 -06:00
HenocKA
6a51746bb7 bug correction 2016-02-10 17:45:05 +01:00
HenocKA
7a00d913a1 update branch 2016-02-06 06:52:21 +01:00
HenocKA
8a3d14f9e2 Correct data duplication on discovering cisco vrf lite 2016-02-02 12:21:45 +01:00
HenocKA
0ac8f584b2 discoverying and polling VRF 2016-01-26 15:22:49 +01:00
laf
427c4f07c6 Added ability to ignore device sensors from entity mib 2016-01-25 22:37:38 +00:00
Mike Rostermund
e2d1a8e7d9 Replaced custom utime() function with microtime(true) 2016-01-08 13:33:32 +01:00
Mike Rostermund
a1261a0aeb Replace utime() for microtime(true) 2016-01-08 08:41:12 +01:00
Mike Rostermund
51d2e32c36 Print runtimes for each individual polling and discovery module. 2016-01-07 12:04:51 -08:00
Paul Gear
2244a5f31d Fix issues flagged by scrutinizer 2016-01-02 07:10:43 +10:00
Paul Gear
953ea3fa15 Add device OID storage and display 2016-01-02 07:10:42 +10:00
Paul Gear
40a1cef050 Generalise arp discovery cache; move to common 2016-01-02 07:10:42 +10:00
Eldon Koyle
fb0501588e Fix librenms auto-discovery 2015-11-18 14:48:54 -07:00
laf
76f862fddd Updated to disable auto-discovery by ip 2015-10-20 16:12:03 +00:00
Mark Schouten
677a4f3f5f Remove all unneeded if($debug)-statements and replace them with d_echo . discovery dir.. 2015-08-21 16:10:01 +02:00
laf
4b49c148b6 Added mysqli support 2015-08-08 19:27:18 +00:00
laf
746c52046b Updated discovery to log new type + updated eventlog page to show this 2015-08-05 20:05:45 +00:00
Mike Rostermund
5369112d48 Fix some scrutinizer coding style issues 2015-08-04 18:36:03 +02:00
laf
c2bcb69982 Fixes Debugging code issues from scrut 2015-07-15 21:32:18 +01:00
Job Snijders
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
laf
adb036759e Updated autodiscovery to use log_event better 2015-07-13 11:52:38 +01:00
Paul Gear
05d315775f Merge pull request #1414 from laf/issue-1197
Updated BGP discovery code to perform autodiscovery if enabled
2015-07-13 08:21:41 +10:00
laf
1bbe1b7ccf Updated to log discovery info via discover_new_device() 2015-07-12 19:57:25 +01:00