69 Commits

Author SHA1 Message Date
c30a5e8977 feature: Added Mikrotik LLDP discovery (#7901)
* Add Mikrotik LLDP discovery

* Add Mikrotik LLDP discovery

* Add Mikrotik LLDP discovery
2017-12-16 22:23:06 +00:00
8ab0b2bffd refactor: Replace custom queries with dbDeleteOrphans(). (#7862)
* Replace custom queries with dbDeleteOrphans().
Generalize dbDeleteOrphans() a bit more.  Allow for multiple tables and custom key pairs.

* fix whitespace
2017-12-06 22:44:23 +00:00
f01cf38a3a fix: lldp discovery change local port resolution (#7443)
* fix: lldp discovery change local port resolution
dot1dBasePortIfIndex seems to skip some ports in certain configurations on Cisco devices.
Add quirk for Calix devices that return different port labels than they actually are.

* bdcom uses NMS-LLDP-MIB too.

* use dot1dBasePort to look up ifIndex if we can.
2017-10-24 08:21:32 +01:00
f92449e637 fix: issues with recent discovery refactor (#7437)
fix find_port_id() deleting all variables when device_id was given
improve find_port_id() to find ports where only a number is given
fix orphan deletion count
fix insert and update of links with strings where int are required
2017-10-06 08:53:16 -05:00
c0b267b49c refactor: Discovery protocols re-write (#7380)
* refactor: discovery protocols re-write
extract more code to make it easier to read
use snmpwalk_group
walk lldpRemTable instead of lldpRemoteSystemsData
Optimize discover_device to reduce dns lookups of bad dns names
Make discovery_by_ip behavior consistent between cdp and lldp
move can_skip_discovery to discovery functions

Tested lldp, cdp, and ospf.

* always discover links even if the remote device isn't in system
Fix discover_link always updating

* fix style

* fix update, not fetching id

* increase platform length.  Most devices use sysDescr here, which is max length 255

* remove orphaned links

* update db_schema.yaml
2017-10-04 08:16:23 +01:00
b18c41b1a9 refactor: Use the Config class includes/discovery (#7299)
* refactor: use the Config class includes/discovery

* fix issue with $config variable not accessible in include-dir.inc.php

* improved whitespace

* Tidy up discovery_by_ip
2017-09-11 21:26:41 +01:00
1d777693e1 feature: New IP parsing classes. Removes usage of Pear Net_IPv4 and Net_IPv6. (#7106)
* Refactor remove use of pear Net_IPv4 and Net_IPv6

Caution, I added tests to test the functionality of the new functions, but I'm not 100% certain the replaced usages match 100%.  Please test.

Left usage in generate-iplist.php because I'm not sure the use of that script, so I didn't want to implement additional functionality to support it.

Add support for ipv6 fo ipInNetwork() function

Add phpdocs to functions
Remove accidental inclusion

Use binary operations instead of string for networKFromIp()
Tidy up binary operations in ipInNetwork()

tidy parsing cidr network

Change to a class based implementation.

Update phpdocs.
Fully catch exceptions for hex parsing.

Fix mistake.

support older phpunit versions

Fix php shifting to negative with php 5

* Fix graph authorization. Uncaught exception and checking an ipv4 against an ipv6 network == fail.

* Also remove colons from hex strings.

* Fix typo in bgp polling
Two passes of removing invalid characters from hex strings. (That way we don't mangle valid IPs)
2017-08-08 14:14:58 -05:00
bda5a4343e fix: Fixed auto discovery for lldp not adding new hosts (#6919) 2017-06-29 19:29:33 +01:00
90aa485149 refactor: discovery code cleanups (#6856)
* Use foreach $key => value

* use get_port_by_ifIndex
get rid of the rest of the array_keys()

* improve hex_to_ip() function, add tests, use in more places

* Simplify can_skip_discovery logic
2017-06-22 21:08:20 +01:00
3512b19e2b feature: Update LLDP discovery to use IP address if discovery_by_ip is enabled #5872
* Update LLDP discovery to use IP address if discovery_by_ip is enabled

* Update as per laf's suggetions

* Fix indentation

* Updated with Laf's suggestion

* Add more debugging

* Trim MAC address

* Remove debug statements
2017-02-23 22:47:58 +00:00
21898a3c29 Disco / Poller tidy up + Added display of module mem usage (#5778)
* tidyup + added mem usage for poller modules

* tidied up discovery modules

* fix sensors
2017-02-07 22:54:30 -06:00
3fb65da339 fix: Fix for issue #5525
* Update discovery-protocols.inc.php

Allow invalid hostnames if discovery by IP is true

* Update AUTHORS.md

signing

* Update AUTHORS.md

signing

* CDP discovery by IP modification

CDP would not discover devices that had invalid DNS value for cdpCacheDeviceId - modified to accept 
Also exclude adding devices whose hostname matches the IP

* Update AUTHORS.md

* I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.
2017-01-26 22:52:13 +00:00
175db1deb5 fix lldp discovery 2016-10-20 20:36:18 -04:00
41a40bf6e6 fix copy paste error 2016-10-20 20:24:40 -04:00
laf
46d2f578e7 added central function and updated 2016-10-18 03:06:03 +00:00
2aae3e6dff add xdp exclude device filters 2016-10-17 00:38:47 -04:00
edbb6ae0e3 refactor: Centralize MIB include directory specification (#4603)
* refactor: Centralize MIB include directory specification
The default is now:
```
$config['mib_dir'].'/mibdirname:'.$config['mib_dir']
```
This means we exclude OS mibs and only use ours  (we could prepend `+` if we want to include os mibs.
All snmp calls should only include the name of the subdirectory under the mibs directory.

* Remove d_echo from Proc
Fix snmpsim tests.
2016-09-28 14:19:28 +01:00
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
f019a28d8c and a semicolon 2016-08-15 14:53:44 -06:00
71625f6aba fix whitespace (spaces, not tabs) 2016-08-15 14:44:19 -06:00
c405c38eff Check against the proper subtype variable, initialize variable 2016-08-15 11:52:21 -06:00
34f503afb8 Use port instead of chassis ID for port matching
Code was improperly using chassis id for port matching.

Fixes #4069 .
2016-08-15 11:40:11 -06:00
850c4a2f92 move pbn mibs to subdirectory 2016-08-07 11:40:37 +02:00
laf
558dfb2344 Pretty up the discovery process output 2016-06-21 00:59:43 +01:00
a5d0b0a306 Changed syntax of if statement for readability 2016-05-26 20:43:56 +01:00
18eab48d7e Correct array name 2016-05-25 20:13:56 +01:00
db5d074a52 Enable discovery of CDP neighbour by IP address 2016-05-25 09:52:28 +01:00
4bd3b12c44 revert to fetchRow 2015-12-13 21:00:39 +01:00
7237c84164 change fetchRow to fetchCell 2015-12-13 20:24:08 +01:00
29e708819a closes #2614 2015-12-13 20:15:43 +01:00
8ed1a50657 Added parameter for sql query to check ifPhysAddress as thats what lldpRemPortId is 2015-12-09 20:37:15 +00:00
677a4f3f5f Remove all unneeded if($debug)-statements and replace them with d_echo . discovery dir.. 2015-08-21 16:10:01 +02:00
009cfdf13f ource of MIBs is www.pbnglobal.com 2015-08-17 20:44:52 +02:00
5fea54ca6a add NMS-LLDP-MIB discovery for PBN devices 2015-08-17 18:12:49 +02:00
laf
de0f9ee697 PBN devices support CDP but does not output like Cisco so using a different function to grab the first array needed 2015-08-04 20:37:05 +00:00
laf
741742aa85 Added debug to discovery protocols + stop them running if not configured 2015-08-02 19:23:54 +00:00
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
laf
ac0221f7e5 Update SQL query for ospf_nbrs lookup to use device_id 2015-05-20 13:41:23 +01:00
ab66b453e4 Make OSPF & ARP autodiscovery independent of xDP autodiscovery
Both OSPF & ARP discovery use discover_new_device(), but it was checking
$config[autodiscovery][xdp] internally, meaning xDP had to be enabled for the other two to work.
2015-05-18 20:32:11 +10:00
5a7988e2e4 chmod 0644 to php files not directly executed 2015-04-28 22:58:03 +02:00
laf
c8a5a90364 Updated dbFetchRows 2015-04-11 15:45:17 +01:00
laf
818cbcc731 Added ospf discovery 2015-04-11 15:01:14 +01:00
laf
8f5d6e8a94 Added code to rediscovery links and include device ids 2015-03-28 14:05:40 +00:00
laf
3483952dd7 Fixed more backticks missing 2014-06-24 02:43:05 +01:00
laf
02792176fa Updated most files to use dbFacile 2014-03-12 22:21:33 +00:00
4db1454e92 move from port_id to interface_id. make ports discovery only discover. add some cleaner functions. add a tiny bit of alerting infrastructure.
git-svn-id: http://www.observium.org/svn/observer/trunk@3195 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-16 13:25:50 +00:00
3407022cb0 add loadbalancer device type, netscaler = loadbalancer, patch by mgm
git-svn-id: http://www.observium.org/svn/observer/trunk@2844 61d68cd4-352d-0410-923a-c4978735b2b8
2012-01-20 13:15:05 +00:00
fe53a6b9ff move cdp detection to dbFacile, make dbFacile debugging output put \n before output
git-svn-id: http://www.observium.org/svn/observer/trunk@2791 61d68cd4-352d-0410-923a-c4978735b2b8
2011-12-16 14:42:37 +00:00
de3dda9c0b fix cdp discovery exclusions, adds is_valid_hostname function; get values from database if cache is not populated
git-svn-id: http://www.observium.org/svn/observer/trunk@2657 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-06 13:13:15 +00:00