X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=doc%2Frrdfetch.txt;h=1c7a9aae1b0782f04cf916751d5d561de21e9846;hb=91b2f1022a195d008d818f283690ef63a00fd79c;hp=70f24db5f7348db4ccea70ca8dd9c946ac7d72cb;hpb=412b079ae92adc47a82bfc6a27de37a537420a26;p=pkg-rrdtool.git diff --git a/doc/rrdfetch.txt b/doc/rrdfetch.txt index 70f24db..1c7a9aa 100644 --- a/doc/rrdfetch.txt +++ b/doc/rrdfetch.txt @@ -7,14 +7,14 @@ NNAAMMEE SSYYNNOOPPSSIISS rrrrddttooooll ffeettcchh _f_i_l_e_n_a_m_e _C_F [----rreessoolluuttiioonn|--rr _r_e_s_o_l_u_t_i_o_n] - [----ssttaarrtt|--ss _s_t_a_r_t] [----eenndd|--ee _e_n_d] + [----ssttaarrtt|--ss _s_t_a_r_t] [----eenndd|--ee _e_n_d] [----ddaaeemmoonn _a_d_d_r_e_s_s] DDEESSCCRRIIPPTTIIOONN The ffeettcchh function is normally used internally by the graph function to get data from RRRRDDs. ffeettcchh will analyze the RRRRDD and try to retrieve the - data in the resolution requested. The data fetched is printed to std- - out. _*_U_N_K_N_O_W_N_* data is often represented by the string "NaN" depending - on your OS's printf function. + data in the resolution requested. The data fetched is printed to + stdout. _*_U_N_K_N_O_W_N_* data is often represented by the string "NaN" + depending on your OS's printf function. _f_i_l_e_n_a_m_e the name of the RRRRDD you want to fetch the data from. @@ -39,12 +39,20 @@ DDEESSCCRRIIPPTTIIOONN STYLE TIME SPECIFICATION section for a detailed explanation of how to specify the end time. - RREESSOOLLUUTTIIOONN IINNTTEERRVVAALL + ----ddaaeemmoonn _a_d_d_r_e_s_s + Address of the rrdcached daemon. If specified, a "flush" + command is sent to the server before reading the RRD files. + This allows rrrrddttooooll to return fresh data even if the daemon is + configured to cache values for a long time. For a list of + accepted formats, see the --ll option in the rrdcached manual. - In order to get RRDtool to fetch anything other than the finest resolu- - tion RRA bbootthh the start and end time must be specified on boundaries - that are multiples of the desired resolution. Consider the following - example: + rrdtool fetch --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd AVERAGE + + RREESSOOLLUUTTIIOONN IINNTTEERRVVAALL + In order to get RRDtool to fetch anything other than the finest + resolution RRA bbootthh the start and end time must be specified on + boundaries that are multiples of the desired resolution. Consider the + following example: rrdtool create subdata.rrd -s 10 DS:ds0:GAUGE:300:0:U \ RRA:AVERAGE:0.5:30:3600 \ @@ -92,22 +100,20 @@ DDEESSCCRRIIPPTTIIOONN system "rrdtool fetch subdata.rrd AVERAGE \ -r $rrdres -e @{[int($ctime/$rrdres)*$rrdres]} -s e-1h"' - AATT--SSTTYYLLEE TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN - + AATT--SSTTYYLLEE TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN Apart from the traditional _S_e_c_o_n_d_s _s_i_n_c_e _e_p_o_c_h, RRDtool does also understand at-style time specification. The specification is called "at-style" after the Unix command _a_t(1) that has moderately complex ways to specify time to run your job at a certain date and time. The - at-style specification consists of two parts: the TTIIMMEE RREEFFEERREENNCCEE speci- - fication and the TTIIMMEE OOFFFFSSEETT specification. + at-style specification consists of two parts: the TTIIMMEE RREEFFEERREENNCCEE + specification and the TTIIMMEE OOFFFFSSEETT specification. - TTIIMMEE RREEFFEERREENNCCEE SSPPEECCIIFFIICCAATTIIOONN - - The time reference specification is used, well, to establish a refer- - ence moment in time (to which the time offset is then applied to). When - present, it should come first, when omitted, it defaults to nnooww. On its - own part, time reference consists of a _t_i_m_e_-_o_f_-_d_a_y reference (which - should come first, if present) and a _d_a_y reference. + TTIIMMEE RREEFFEERREENNCCEE SSPPEECCIIFFIICCAATTIIOONN + The time reference specification is used, well, to establish a + reference moment in time (to which the time offset is then applied to). + When present, it should come first, when omitted, it defaults to nnooww. + On its own part, time reference consists of a _t_i_m_e_-_o_f_-_d_a_y reference + (which should come first, if present) and a _d_a_y reference. The _t_i_m_e_-_o_f_-_d_a_y can be specified as HHHH::MMMM, HHHH..MMMM, or just HHHH. You can suffix it with aamm or ppmm or use 24-hours clock. Some special times of @@ -120,24 +126,23 @@ DDEESSCCRRIIPPTTIIOONN ttooddaayy, ttoommoorrrrooww. You can also specify the _d_a_y as a full date in several numerical formats, including MMMM//DDDD//[[YYYY]]YYYY, DDDD..MMMM..[[YYYY]]YYYY, or YYYYYYYYMMMMDDDD. - _N_O_T_E_1: this is different from the original _a_t(1) behavior, where a sin- - gle-number date is interpreted as MMDD[YY]YY. + _N_O_T_E_1: this is different from the original _a_t(1) behavior, where a + single-number date is interpreted as MMDD[YY]YY. _N_O_T_E_2: if you specify the _d_a_y in this way, the _t_i_m_e_-_o_f_-_d_a_y is REQUIRED as well. - Finally, you can use the words nnooww, ssttaarrtt, or eenndd as your time refer- - ence. NNooww refers to the current moment (and is also the default time - reference). SSttaarrtt (eenndd) can be used to specify a time relative to the - start (end) time for those tools that use these categories (rrrrddffeettcchh, - rrdgraph). - - Month and day of the week names can be used in their naturally abbrevi- - ated form (e.g., Dec for December, Sun for Sunday, etc.). The words - nnooww, ssttaarrtt, eenndd can be abbreviated as nn, ss, ee. + Finally, you can use the words nnooww, ssttaarrtt, or eenndd as your time + reference. NNooww refers to the current moment (and is also the default + time reference). SSttaarrtt (eenndd) can be used to specify a time relative to + the start (end) time for those tools that use these categories + (rrrrddffeettcchh, rrdgraph). - TTIIMMEE OOFFFFSSEETT SSPPEECCIIFFIICCAATTIIOONN + Month and day of the week names can be used in their naturally + abbreviated form (e.g., Dec for December, Sun for Sunday, etc.). The + words nnooww, ssttaarrtt, eenndd can be abbreviated as nn, ss, ee. + TTIIMMEE OOFFFFSSEETT SSPPEECCIIFFIICCAATTIIOONN The time offset specification is used to add/subtract certain time intervals to/from the time reference moment. It consists of a _s_i_g_n (++ or --) and an _a_m_o_u_n_t. The following time units can be used to specify @@ -148,10 +153,10 @@ DDEESSCCRRIIPPTTIIOONN = -5h-45min = -6h+15min = -7h+1h30m-15min, etc.) _N_O_T_E_3: If you specify time offset in days, weeks, months, or years, you - will end with the time offset that may vary depending on your time ref- - erence, because all those time units have no single well defined time - interval value (1 year contains either 365 or 366 days, 1 month is 28 - to 31 days long, and even 1 day may be not equal to 24 hours twice a + will end with the time offset that may vary depending on your time + reference, because all those time units have no single well defined + time interval value (1 year contains either 365 or 366 days, 1 month is + 28 to 31 days long, and even 1 day may be not equal to 24 hours twice a year, when DST-related clock adjustments take place). To cope with this, when you use days, weeks, months, or years as your time offset units your time reference date is adjusted accordingly without too much @@ -163,30 +168,30 @@ DDEESSCCRRIIPPTTIIOONN invalid time/date combination (because of 3am -> 4am DST forward clock adjustment, see the below example). - In contrast, hours, minutes, and seconds are well defined time inter- - vals, and these are guaranteed to always produce time offsets exactly - as specified (e.g. for EET timezone, '8:00 Mar 27 1999 +2 days' = - '8:00 Mar 29 1999', but since there is 1-hour DST forward clock adjust- - ment that occurs around 3:00 Mar 28 1999, the actual time interval - between 8:00 Mar 27 1999 and 8:00 Mar 29 1999 equals 47 hours; on the - other hand, '8:00 Mar 27 1999 +48 hours' = '9:00 Mar 29 1999', as - expected) + In contrast, hours, minutes, and seconds are well defined time + intervals, and these are guaranteed to always produce time offsets + exactly as specified (e.g. for EET timezone, '8:00 Mar 27 1999 +2 days' + = '8:00 Mar 29 1999', but since there is 1-hour DST forward clock + adjustment that occurs around 3:00 Mar 28 1999, the actual time + interval between 8:00 Mar 27 1999 and 8:00 Mar 29 1999 equals 47 hours; + on the other hand, '8:00 Mar 27 1999 +48 hours' = '9:00 Mar 29 1999', + as expected) _N_O_T_E_4: The single-letter abbreviation for both mmoonntthhss and mmiinnuutteess is mm. To disambiguate them, the parser tries to read your mind :) by applying the following two heuristics: - 1 If mm is used in context of (i.e. right after the) years, months, + 1. If mm is used in context of (i.e. right after the) years, months, weeks, or days it is assumed to mean mmoonntthhss, while in the context of hours, minutes, and seconds it means minutes. (e.g., in -1y6m or +3w1m mm is interpreted as mmoonntthhss, while in -3h20m or +5s2m mm the parser decides for mmiinnuutteess). - 2 Out of context (i.e. right after the ++ or -- sign) the meaning of mm + 2. Out of context (i.e. right after the ++ or -- sign) the meaning of mm is guessed from the number it directly follows. Currently, if the number's absolute value is below 25 it is assumed that mm means - mmoonntthhss, otherwise it is treated as mmiinnuutteess. (e.g., -25m == -25 min- - utes, while +24m == +24 months) + mmoonntthhss, otherwise it is treated as mmiinnuutteess. (e.g., -25m == -25 + minutes, while +24m == +24 months) _F_i_n_a_l _N_O_T_E_S: Time specification is case-insensitive. Whitespace can be inserted freely or omitted altogether. There are, however, cases when @@ -195,8 +200,7 @@ DDEESSCCRRIIPPTTIIOONN your shell or use '_' (underscore) or ',' (comma) which also count as whitespace (e.g., midnight_Thu or midnight,Thu). - TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN EEXXAAMMPPLLEESS - + TTIIMMEE SSPPEECCIIFFIICCAATTIIOONN EEXXAAMMPPLLEESS _O_c_t _1_2 -- October 12 this year _-_1_m_o_n_t_h or _-_1_m -- current time of day, only a month before (may yield @@ -223,9 +227,18 @@ DDEESSCCRRIIPPTTIIOONN _1_9_9_7_0_7_0_3 _1_2_:_4_5 -- 12:45 July 3th, 1997 (my favorite, and its even got an ISO number (8601)). +EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS + The following environment variables may be used to change the behavior + of "rrdtool fetch": + + RRRRDDCCAACCHHEEDD__AADDDDRREESSSS + If this environment variable is set it will have the same effect as + specifying the "--daemon" option on the command line. If both are + present, the command line argument takes precedence. + AAUUTTHHOORR Tobias Oetiker -1.3rc4 2008-03-15 RRDFETCH(1) +1.4.2 2008-09-25 RRDFETCH(1)