.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RRDp 3pm" .TH RRDp 3pm "2019-10-31" "perl v5.30.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RRDp \- Attach RRDtool from within a perl script via a set of pipes; .SH "SYNOPSIS" .IX Header "SYNOPSIS" use \fBRRDp\fR .PP \&\fBRRDp::start\fR \fIpath to RRDtool executable\fR .PP \&\fBRRDp::cmd\fR \fIrrdtool commandline\fR .PP \&\f(CW$answer\fR = \fBRRD::read\fR .PP \&\f(CW$status\fR = \fBRRD::end\fR .PP \&\fB\f(CB$RRDp::user\fB\fR, \fB\f(CB$RRDp::sys\fB\fR, \fB\f(CB$RRDp::real\fB\fR, \fB\f(CB$RRDp::error_mode\fB\fR, \fB\f(CB$RRDp::error\fB\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" With this module you can safely communicate with the RRDtool. .PP After every \fBRRDp::cmd\fR you have to issue an \fBRRDp::read\fR command to get \&\fBRRDtool\fRs answer to your command. The answer is returned as a pointer, in order to speed things up. If the last command did not return any data, \fBRRDp::read\fR will return an undefined variable. .PP If you import the \s-1PERFORMANCE\s0 variables into your namespace, you can access RRDtool's internal performance measurements. .IP "use \fBRRDp\fR" 8 .IX Item "use RRDp" Load the RRDp::pipe module. .IP "\fBRRDp::start\fR \fIpath to RRDtool executable\fR" 8 .IX Item "RRDp::start path to RRDtool executable" start RRDtool. The argument must be the path to the RRDtool executable .IP "\fBRRDp::cmd\fR \fIrrdtool commandline\fR" 8 .IX Item "RRDp::cmd rrdtool commandline" pass commands on to RRDtool. Check the RRDtool documentation for more info on the RRDtool commands. .Sp \&\fBNote\fR: Due to design limitations, \fBRRDp::cmd\fR does not support the \&\f(CW\*(C`graph \-\*(C'\fR command \- use \f(CW\*(C`graphv \-\*(C'\fR instead. .ie n .IP "$answer = \fBRRDp::read\fR" 8 .el .IP "\f(CW$answer\fR = \fBRRDp::read\fR" 8 .IX Item "$answer = RRDp::read" read RRDtool's response to your command. Note that the \f(CW$answer\fR variable will only contain a pointer to the returned data. The reason for this is, that RRDtool can potentially return quite excessive amounts of data and we don't want to copy this around in memory. So when you want to access the contents of \f(CW$answer\fR you have to use $$answer which dereferences the variable. .ie n .IP "$status = \fBRRDp::end\fR" 8 .el .IP "\f(CW$status\fR = \fBRRDp::end\fR" 8 .IX Item "$status = RRDp::end" terminates RRDtool and returns RRDtool's status ... .IP "\fB\f(CB$RRDp::user\fB\fR, \fB\f(CB$RRDp::sys\fB\fR, \fB\f(CB$RRDp::real\fB\fR" 8 .IX Item "$RRDp::user, $RRDp::sys, $RRDp::real" these variables will contain totals of the user time, system time and real time as seen by RRDtool. User time is the time RRDtool is running, System time is the time spent in system calls and real time is the total time RRDtool has been running. .Sp The difference between user + system and real is the time spent waiting for things like the hard disk and new input from the Perl script. .IP "\fB\f(CB$RRDp::error_mode\fB\fR and \fB\f(CB$RRDp::error\fB\fR" 8 .IX Item "$RRDp::error_mode and $RRDp::error" If you set the variable \f(CW$RRDp::error_mode\fR to the value 'catch' before you run RRDp::read a potential \&\s-1ERROR\s0 message will not cause the program to abort but will be returned in this variable. If no error occurs the variable will be empty. .Sp .Vb 3 \& $RRDp::error_mode = \*(Aqcatch\*(Aq; \& RRDp::cmd qw(info file.rrd); \& print $RRDp::error if $RRDp::error; .Ve .SH "EXAMPLE" .IX Header "EXAMPLE" .Vb 8 \& use RRDp; \& RRDp::start "/usr/local/bin/rrdtool"; \& RRDp::cmd qw(create demo.rrd \-\-step 100 \& DS:in:GAUGE:100:U:U \& RRA:AVERAGE:0.5:1:10); \& $answer = RRDp::read; \& print $$answer; \& ($usertime,$systemtime,$realtime) = ($RRDp::user,$RRDp::sys,$RRDp::real); .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" For more information on how to use RRDtool, check the manpages. .SH "AUTHOR" .IX Header "AUTHOR" Tobias Oetiker