rsys-dev 6394c35ce6 Graylog entry matching device if source is not hostname or primary ip (#10458)
* Added findByHostnameOrIp($hostnameOrIp) for devices.
    Returns Device or null
Fixed Graylog device links, "device" parameter in URL was IP or Hostname instead of device id before
Added Severity number to name conversion. Can be activated by setting $config['graylog']['severity-names'] = "true" in config
Added Facility number to name conversion. Can be activated by setting $config['graylog']['facility-names'] = "true" in config

* Added $config['graylog']['match-any-address']. To enable matching Graylog entries by any interface address set to "true"
Added code to match Graylog entries by any interface address instead of only hostname or primary address

* Fixed missing quotation marks in <script> block in includes/html/common/graylog.inc.php:46, causing graylog page only load header with empty table. Introduced in https://github.com/librenms/librenms/pull/10447

* Modified code to reduce complexity as mentioned by codeclimate

* Changed findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Added Language File "syslog.php" for Syslog Severity and Facility
Merged functions "levelName($level)" and "facilityName($facility)" to "syslogPrioParser($type, $value)" where $type should be "facility" or "severity" and $value the numeric or text facility or severity. Returns "NUMBER (NAME)" if possible, otherwhise returns $value

* Shortened findByHostnameOrIp($hostnameOrIp) as mentioned by https://github.com/murrant

* Add shortcut ipv4 and ipv6 device relationships
Better code for adding source addresses
Only translate level and facility if they are numeric
Allow level and facility to be sortable
No need for device link if we know it won't work.  Before the code was punting to save sql queries.

* Cache devices
Took queries from 69 to 6 in my quick test.

* Added Documentation for $config['graylog']['match-any-address']

* Fixed missing quotation marks in app/ApiClients/GraylogApi.php:125
2019-07-26 15:13:35 -05:00
..