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

Poller query to UPDATE devices fails, resulting in cyclic "Device not yet polled" caused by bad escaping of array(NULL) in SQL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • None
    • Community Edition
    • Poller
    • CE 0.14.11.6000, CentOS 6, PHP 5.3.3, MySQL 5.1.73

    Description

      While having in config.php:

      $config['geocoding']['enable'] = FALSE;
      

      New devices are not polled and results in "Device not yet polled" state even if graphs are working.

      "UPDATE devices ..." query fails on syntax, because it is assembled into somethink like:

      UPDATE `devices` set `uptime` ='36266894',`sysObjectID` ='.1.3.6.1.4.1.30803',`sysContact` ='*censored*',`sysName` ='*censored*',`sysDescr` ='*censored*',`location_lat` =,`location_lon` =,`location` ='PRAGUE',`version` ='*censored*',`features` ='*censored*',`last_polled` =NOW(),`last_polled_timetaken` ='1.6188',`device_state` ='*censored*' WHERE `device_id` = '6'
      

      In /includes/polling/system.inc.php location_lat and location_lon are set to array(NULL), forcing geocoding to resolve location, but when geocoding is disabled array(NULL) is wrongly compiled/escaped in SQL to "nothink" instead of "NULL".

      Attachments

        Activity

          People

            landy Mike Stupalov
            brona Bronislav Robenek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: