Changes to geolocation handling

I would like to try to make a few changes to how geolocation is handled in librenms.

During discovery:

  1. Any [lat,long] in the sysLocation string takes precedence
  2. If [lat,long] is missing in the sysLocation string, an attempt is made to find a DNS LOC record. (In case of a non-FQDN, an initial reverse lookup may be required first.)
  3. If no DNS LOC record is found, $config[‘defaultgeoloc’] is set as coordinates.
  4. If $config[‘defaultgeoloc’] is not set, no coordinates are set. (Or a hardcoded set?)

In web-UI:

  1. Devices are grouped in Devices | Geolocations by the non-[lat,long] part of sysLocation only.
  2. Device Overview displays the text part of sysLocation as well as any coordinates (independent of source) in the location field.
  3. The separate Lat/Lng field in the Device Overview is removed

Opinions? Thoughts? Advice?

1 Like

Looks like I need to take into consideration the Geocode service as well.
And there appears to be some location stuff happening during polling as well, not just during discovery.

All seems good to me.

I’d be ecstatic if DNS LOC was implemented - Allow DNS LOC record as source for location :grinning: