Discovery failing for invalid hostnames even when discovery_by_ip enabled #5525

towster opened this Issue Jan 20, 2017 · 0 comments


None yet

2 participants

towster commented Jan 20, 2017


Please read this information carefully.

GitHub issues is for feature requests or bugs, please do not post issues asking for help or how to do X, Y or Z.
You can use our irc channel ##librenms on freenode to ask questions or our community site.

Please confirm each of the sections below by putting an x in the box like [x].

  • Is your install up to date? Updating your install
    Please do not submit an issue if your install is not up to date within the last 24 hours or on a stable monthly release.
  • Please include all of the information between the ==================================== section of ./validate.php which you can run from the cli.
  • Unless your issue is for a WebUI fix or feature then please provide ALL info asked for here.
  • Please provide as much detail as possible.
  • Please do NOT post more than 10 lines of debug information here, use a pastebin service or GitHub Gists.
==========================================================Component Version
LibreNMS 81bde0b
DB Schema 156
PHP 7.0.14
MySQL 5.5.52-MariaDB
RRDTool 1.4.8

Lots of info on the issue is posted here:

TL;DR; The two devices that are missing are:

    [cdpCacheDeviceId] => DC-NEXUS-5K-H7-2(SSI144007HH)
    [cdpCacheDeviceId] => DC-NEXUS-5K-H7-1(SSI144007GJ)

They are failing to pass this condition in

        if (is_valid_hostname($cdp['cdpCacheDeviceId'])) {

I am thinking it should be changed to something like:

            if (is_valid_hostname($cdp['cdpCacheDeviceId']) || ($config['discovery_by_ip'] == true)) {

I have tested that on my install and will submit patch for this..

@laf laf added a commit that referenced this issue Jan 26, 2017
@towster @laf towster + laf fix: Fix for issue #5525
* Update

Allow invalid hostnames if discovery by IP is true

* Update


* Update


* 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

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

I agree to the conditions of the Contributor Agreement contained in doc/General/
@laf laf closed this Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment