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

Dashboards: Filter with time does'n work for widget with period in widget_config - need migrate

    XMLWordPrintable

Details

    Description

      Great!
      Now we have new dashboards with time ranges (for example: &from=now-24h&to=now).

      But early for adding graph to dashboards I select a graph for 2 days, so I have something like this

      MariaDB [observium]> SELECT widget_id,widget_config FROM dash_widgets WHERE  dash_id = 7 AND widget_type = "graph";
      +-----------+---------------------------------------------------------------------+
      | widget_id | widget_config                                                       |
      +-----------+---------------------------------------------------------------------+
      |       144 | {"type":"device_processor","period":"172800","device":"411"}        |
      |       145 | {"type":"port_bits","period":"172800","id":"16746"}                 |
      |       146 | {"type":"device_processor","period":"172800","device":"505"}        |
      |       147 | {"type":"port_bits","period":"172800","id":"44040"}                 |
      |       148 | {"type":"device_processor","period":"172800","device":"504"}        |
      |       149 | {"type":"device_bits","period":"86400","device":"504"}              |
      |       150 | {"type":"device_gauge","period":"172800","device":"411"}            |
      |       151 | {"type":"device_ucd_memory","period":"172800","device":"508"}       |
      |       152 | {"type":"device_ucd_memory","period":"172800","device":"533"}       |
      |       153 | {"type":"multi-port_bits","period":"172800","id":["35443","35444"]} |
      |       154 | {"type":"port_bits","period":"172800","id":"71087"}                 |
      |       155 | {"type":"device_processor","period":"172800","device":"508"}        |
      |       156 | {"type":"device_processor","period":"172800","device":"533"}        |
      |       157 | {"type":"device_storage","period":"172800","device":"508"}          |
      |       159 | {"type":"device_storage","period":"172800","device":"533"}          |
      |       160 | {"type":"device_diskio_bits","period":"172800","device":"508"}      |
      |       161 | {"type":"device_diskio_bits","period":"172800","device":"533"}      |
      |       162 | {"type":"device_temperature","period":"172800","device":"411"}      |
      |       163 | {"type":"device_temperature","period":"172800","device":"504"}      |
      |       164 | {"type":"device_temperature","period":"172800","device":"505"}      |
      |       165 | {"type":"device_temperature","period":"172800","device":"508"}      |
      |       166 | {"type":"device_temperature","period":"172800","device":"533"}      |
      |       167 | {"type":"device_temperature","period":"172800","device":"490"}      |
      +-----------+---------------------------------------------------------------------+
      23 rows in set (0,000 sec)
      

      If i try to use time range - no effect, because graph URL is changed from
      https://observiumURL/graph.php?type=device_bits&period=86400&device=504&from=1791384654&to=1791471054&width=237&height=90&draw_all=yes&rigid_height=yes&class=image-refresh
      to
      https://observiumURL/graph.php?type=device_bits&period=86400&device=504&from=1790866264&to=1791471064&width=237&height=90&draw_all=yes&rigid_height=yes&class=image-refresh

      I think we need migration to remove '"period":"172800",' FROM widget_config in dash_widgets table.

      I fix it via

      UPDATE dash_widgets SET widget_config = REPLACE(widget_config, '"period":"172800",', '') ;
      UPDATE dash_widgets SET widget_config = REPLACE(widget_config, '"period":"86400",', '') ;
      

      Attachments

        Activity

          People

            adama Adam Armstrong
            mtivi Martyushev Tim
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: