Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-2858

Add latitude / longitude to devices API - bug in devices.inc.php preventing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Professional Edition
    • API
    • None

    Description

      Device API currently displays [devices][id][location], which is the snmp location. Request to add lat/lon to this, which is already present in sql in observium.devices_locations.latitutde and longitude.

      This table is already left joined in a query in:
      ./html/api/v0/includes/devices.inc.php

      .. but I don't think this is actually doing anything as the location listed is already in the devices table.

      It looks like it's checking for $config['geocoding']['enable'] within the api_get_devices() function, but it's not getting $config passed so it's always a FALSE.

      if config were passed via this line:

      Flight::route('GET /devices', 'api_get_devices');

      it would probably solve this. I'm unfamiliar with Flight::route so It wasn't straightforward to me how to pass this. I tried to change the last part of api_get_devices to api_get_devices($config) but it did not enjoy it.

      Attachments

        Activity

          People

            adama Adam Armstrong
            falz falz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: