Rrdtool info: Difference between revisions

From I Will Fear No Evil
Jump to navigation Jump to search
mNo edit summary
Line 62: Line 62:


1685328961: 31 65
1685328961: 31 65
</pre>


Find out when the last metric was received
<pre>
rrdtool last ../../rrd/database.rrd
1685328961
</pre>
</pre>


[[Category:rrd]]
[[Category:rrd]]

Revision as of 19:58, 28 May 2023

Landing point for RRD commands and examples

print the base info from an RRD database

  • Looks like a cheap way to get last values from the database possibly to store for status dashboard without the graph generation
  • This should be easily parsed in both bash and PHP for ds[NAME].last_ds
rrdtool info /opt/nmsApi/rrd/database.rrd
filename = "/opt/nmsApi/rrd/database.rrd"
rrd_version = "0003"
step = 1
last_update = 1685326405
header_size = 1472
ds[temperature].index = 0
ds[temperature].type = "GAUGE"
ds[temperature].minimal_heartbeat = 600
ds[temperature].min = 0.0000000000e+00
ds[temperature].max = 1.0000000000e+02
ds[temperature].last_ds = "31"
ds[temperature].value = 1.4787341000e+01
ds[temperature].unknown_sec = 0
ds[humidity].index = 1
ds[humidity].type = "GAUGE"
ds[humidity].minimal_heartbeat = 600
ds[humidity].min = 0.0000000000e+00
ds[humidity].max = 1.0000000000e+02
ds[humidity].last_ds = "65"
ds[humidity].value = 3.1005715000e+01
ds[humidity].unknown_sec = 0
rra[0].cf = "AVERAGE"
rra[0].rows = 3600
rra[0].cur_row = 3151
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 720
rra[1].cur_row = 501
rra[1].pdp_per_row = 60
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = 7.7500000000e+02
rra[1].cdp_prep[0].unknown_datapoints = 0
rra[1].cdp_prep[1].value = 1.6250000000e+03
rra[1].cdp_prep[1].unknown_datapoints = 0
rra[2].cf = "AVERAGE"
rra[2].rows = 24
rra[2].cur_row = 8
rra[2].pdp_per_row = 3600
rra[2].xff = 5.0000000000e-01
rra[2].cdp_prep[0].value = 2.4260961332e+04
rra[2].cdp_prep[0].unknown_datapoints = 0
rra[2].cdp_prep[1].value = 5.2791045244e+04
rra[2].cdp_prep[1].unknown_datapoints = 0

Another option:

rrdtool lastupdate ../../rrd/database.rrd 
 temperature humidity

1685328961: 31 65

Find out when the last metric was received

rrdtool last ../../rrd/database.rrd 
1685328961