Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Ntpd / gps need some love part II

    Scheduled Pinned Locked Moved Development
    85 Posts 7 Posters 20.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fragged
      last edited by

      To make ntp rrd graphs look nicer I did some changes on my system to allow full scaling from negative to positive values and I made the graph scale a bit nicer (in my opinion).

      Modify rrd.inc to allow negative values. I'm not sure if all of these can actually go to negative, but this was a lazy initial edit. I'm sure none of the values should ever get anywhere close to 1000 though.

      
      $rrdcreate .= "DS:offset:GAUGE:$ntpdvalid:-1000:1000 ";
      $rrdcreate .= "DS:sjit:GAUGE:$ntpdvalid:-1000:1000 ";
      $rrdcreate .= "DS:cjit:GAUGE:$ntpdvalid:-1000:1000 ";
      $rrdcreate .= "DS:wander:GAUGE:$ntpdvalid:-1000:1000 ";
      $rrdcreate .= "DS:freq:GAUGE:$ntpdvalid:-1000:1000 ";
      $rrdcreate .= "DS:disp:GAUGE:$ntpdvalid:-1000:1000 ";
      
      

      Modify the status_rrd_graph_img.php file to scale things better for the actual graph. Another part to touch in this file would be the COMMENT/GPRINT part for ntp graph to tweak the number of decimals etc.

      
      $graphcmd .= "--alt-autoscale ";
      $graphcmd .= "--alt-y-grid ";
      $graphcmd .= "--units-exponent 0 ";
      $graphcmd .= "--rigid ";
      
      

      I've never touched any of the pfSense code before and I don't have a github account nor have I signed the CLA. I would very much appreciate it if someone could take a look at this, make the actual changes needed and post a pull request.

      ntprrd_modified.PNG
      ntprrd_modified.PNG_thumb

      1 Reply Last reply Reply Quote 0
      • C
        charliem
        last edited by

        @fragged:

        To make ntp rrd graphs look nicer I did some changes on my system to allow full scaling from negative to positive values and I made the graph scale a bit nicer (in my opinion).

        Can you post a diff?  Would be easier for others to test.

        Modify rrd.inc to allow negative values. I'm not sure if all of these can actually go to negative, but this was a lazy initial edit. I'm sure none of the values should ever get anywhere close to 1000 though.

        As far as I know, only offset and frequency could have possible negative values.  Jitter and wander are calculated as RMS averages and so should always be positive.  Dispersion is related to delay and latency measurements, both of which should be positive (unless you live in a Tardis …)

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          Plotting negative offset seems like a good idea. What does it show now if it can't go negative? Worst case it shows zero offset unrealistically.

          Steve

          1 Reply Last reply Reply Quote 0
          • F
            fragged
            last edited by

            Negative values are clipped off completely resulting in gaps in the graph.

            1 Reply Last reply Reply Quote 0
            • R
              robi
              last edited by

              @charliem:

              As far as I know, only offset and frequency could have possible negative values.  Jitter and wander are calculated as RMS averages and so should always be positive.  Dispersion is related to delay and latency measurements, both of which should be positive (unless you live in a Tardis …)

              I'd say it's still good if the graphs themselves could plot negative values, because that could potentially show if there are some problems with ntpd.

              I plan to test next week and post a diff too.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.