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

Using human-readable "from" periods produce empty graphs

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Web Interface
    • None

    Description

      Previously for making a graph image with graph.php it was possible to use "human-readable" values for HTTP GET parameter "from", such as:

      • "?from=-1d" (1 day)
      • "?from=-1w" (1 week)
      • "?from=-1m" (1 month)
      • and so on.

      But in our 22.5.12029 using such a "from" parameter produces an empty graph.

      Example request URL:

      https://observium.example.com/graph.php?type=port_bits&id=12345&from=-1d&legend=no&height=400&width=1000&.png

       

      The request is working as normal on demo Observium so seems it broke between 12000 and 12029. Or was it removed/changed on purpose?

      Attachments

        Activity

          [OBS-4119] Using human-readable "from" periods produce empty graphs

          I've restored passthrough of AT/timespec from/to variables on graph.php, but beware that they won't behave the same as the other time passing methods!

          adama Adam Armstrong added a comment - I've restored passthrough of AT/timespec from/to variables on graph.php, but beware that they won't behave the same as the other time passing methods!

          Oh, the "period" parameter is fine then as I can just precalculate how many seconds is "1w" or "1m" and so on. I was afraid only "from"/"to" epoch parameters were left which obviously would not work in a static link.

          Was just wishing there would be some kind of feature changelog - I follow the svn log religiously but this change has definitely not been obvious on it.

          Thanks, the issue can be closed.

          For the record:

          • -1d = period=86400
          • -1w = period=604800
          • -1m = period=2678400 (31 d)
          • -1y = period=31536000
          vojamo Ville Ojamo added a comment - Oh, the "period" parameter is fine then as I can just precalculate how many seconds is "1w" or "1m" and so on. I was afraid only "from"/"to" epoch parameters were left which obviously would not work in a static link. Was just wishing there would be some kind of feature changelog - I follow the svn log religiously but this change has definitely not been obvious on it. Thanks, the issue can be closed. For the record: -1d = period=86400 -1w = period=604800 -1m = period=2678400 (31 d) -1y = period=31536000

          Hi Ville,

          This is somewhat expected behaviour at the moment. The ability to pass through "AT-style" or "timespec" was never fully supported, but we could pass those values through to rrdtool where provided.

          Some of the graph features require us to generate a "period" from the from/to values to do things like showing the "previous" graphing period. I reworked the code that handled this recently because it was split across multiple files and wasn't handling dates correctly.

          There's not really an easy way to do this stuff with AT/timespec in PHP, so we may drop this ability as it will always break certain graph types.

          The "official" way to do these sorts of time periods is with period=<graph period in seconds>

           

           

          adama Adam Armstrong added a comment - Hi Ville, This is somewhat expected behaviour at the moment. The ability to pass through "AT-style" or "timespec" was never fully supported, but we could pass those values through to rrdtool where provided. Some of the graph features require us to generate a "period" from the from/to values to do things like showing the "previous" graphing period. I reworked the code that handled this recently because it was split across multiple files and wasn't handling dates correctly. There's not really an easy way to do this stuff with AT/timespec in PHP, so we may drop this ability as it will always break certain graph types. The "official" way to do these sorts of time periods is with period=<graph period in seconds>    
          vojamo Ville Ojamo added a comment - - edited

          I should have probably said that these "human-readable" values for "from" are massively useful in that: we do not need to know the start time or do any calculations, just ask for graph for the last "x" "days/weeks/monts/years" - very useful for linking to graphs and/or displaying graphs in static web pages and otherwise "dumb" systems.

          Graphs are otherwise working totally fine, just the addition of "from=-1w" (for example) produces an empty graph:

          vojamo Ville Ojamo added a comment - - edited I should have probably said that these "human-readable" values for "from" are massively useful in that: we do not need to know the start time or do any calculations, just ask for graph for the last "x" "days/weeks/monts/years" - very useful for linking to graphs and/or displaying graphs in static web pages and otherwise "dumb" systems. Graphs are otherwise working totally fine, just the addition of "from=-1w" (for example) produces an empty graph:

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            adama Adam Armstrong
            vojamo Ville Ojamo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: