spanjap
Regular Contributor
Copy the code into a newly created file stats.xml and place it in "/opt/var/spool/ntp"
You can now convert it on your 64-bit RT-AC86U with "rrdtool restore -f stats.xml stats.rrd"
The stats.rrd file is now 64-bit and should work.
Test it with "/jffs/bin/ntpstats.sh" and there should be no errors. With the 32-bit file I've got errors. (ds_def malloc)
Code:
<rrd>
<version>0003</version>
<step>300</step> <!-- Seconds -->
<lastupdate>1494526200</lastupdate> <!-- 2017-05-11 20:10:00 CEST -->
<ds>
<name> offset </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>-8.161560</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<ds>
<name> sjit </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>1.248717</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<ds>
<name> cjit </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>5.769</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<ds>
<name> wander </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>0.071</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<ds>
<name> freq </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>6.099</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<ds>
<name> disp </name>
<type> GAUGE </type>
<minimal_heartbeat>1200</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>43.956</last_ds>
<value>NaN</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf>LAST</cf>
<pdp_per_row>1</pdp_per_row> <!-- 300 seconds -->
<params>
<xff>5.0000000000e-01</xff>
</params>
<cdp_prep>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2017-05-10 18:15:00 CEST / 1494432900 --> <row><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v></row>
</database>
</rra>
<rra>
<cf>LAST</cf>
<pdp_per_row>12</pdp_per_row> <!-- 3600 seconds -->
<params>
<xff>5.0000000000e-01</xff>
</params>
<cdp_prep>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
<ds>
<primary_value>NaN</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>2</unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2017-02-04 20:00:00 CET / 1486234800 --> <row><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v><v>NaN</v></row>
</database>
</rra>
</rrd>
You can now convert it on your 64-bit RT-AC86U with "rrdtool restore -f stats.xml stats.rrd"
The stats.rrd file is now 64-bit and should work.
Test it with "/jffs/bin/ntpstats.sh" and there should be no errors. With the 32-bit file I've got errors. (ds_def malloc)
Last edited: