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

app_status field in Applications table does not have a default value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • None
    • None
    • Poller
    • Observium 0.14.6.5583
      CentOS 6.5
      MySQL 5.6.19
      PHP 5.3.3

    Description

      The poller.php script is unable to add applications from the unix-agent. The problem is the app_status field in the Applications table is marked as NOT NULL and does not define a default value. The insert statement from the unix-agent.inc.php does not include the app_status field.

      Debug output from poller.php:
      SQL[SELECT COUNT(*) FROM `applications` WHERE `device_id` = '12' AND `app_type` = 'apache']
      Found new application 'Apache'

      SQL[INSERT INTO `applications` (`device_id`,`app_type`) VALUES ('12','apache')]

      SQL[SELECT COUNT(*) FROM `applications` WHERE `device_id` = '12' AND `app_type` = 'mysql']
      Found new application 'MySQL'

      SQL[INSERT INTO `applications` (`device_id`,`app_type`) VALUES ('12','mysql')]

      Output from MySQL:
      mysql> INSERT INTO `applications` (`device_id`,`app_type`) VALUES ('12','apache');
      ERROR 1364 (HY000): Field 'app_status' doesn't have a default value

      Possible fix:
      I was unable to find the app_status field used anywhere within the system and so set a default value as follows:
      ALTER TABLE applications MODIFY COLUMN app_status VARCHAR(8) NOT NULL DEFAULT '{}';

      Attachments

        Activity

          People

            adama Adam Armstrong
            gamestuf Jim Johnson
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: